1 /* 2 * Copyright the original author or authors. 3 * 4 * Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.mozilla.org/MPL/MPL-1.1.html 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 import org.as2lib.env.log.logger.RootLogger; 18 import org.as2lib.env.log.level.AbstractLogLevel; 19 import org.as2lib.env.log.handler.TraceHandler; 20 import org.as2lib.env.log.repository.LoggerHierarchy; 21 import org.as2lib.env.log.LogManager; 22 23 /** 24 * {@code Flash} is intended for configuration of applications compiled with Flash. 25 * 26 * <p>It allows you to define all Flash specific configurations similar to the 27 * configuration in {@link main.Configuration}. 28 * 29 * <p>The current code uses a common configuration. If you have additional configuration 30 * you have to overwrite (not extend!) this class in your application directory. The 31 * only method that must be declared to be compatible is {@link #init}. 32 * 33 * @author Martin Heidegger 34 * @version 1.0 35 * @see main.Configuration 36 */ 37 class main.Flash { 38 39 /** 40 * Initializes and starts the Flash configuration. 41 * 42 * @see org.as2lib.app.conf.FlashApplication 43 */ 44 public static function init(Void):Void { 45 // inits of logging setup 46 setUpLogging(); 47 } 48 49 /** 50 * Sets up common logging in the Flash environment that uses {@code trace}. 51 */ 52 private static function setUpLogging(Void):Void { 53 // traces log messages 54 var root:RootLogger = new RootLogger(AbstractLogLevel.ALL); 55 root.addHandler(new TraceHandler()); 56 // sets the logger hierarchy as repository 57 LogManager.setLoggerRepository(new LoggerHierarchy(root)); 58 } 59 60 }