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.LogManager;
    18  import org.as2lib.env.log.logger.RootLogger;
    19  import org.as2lib.env.log.handler.RichInternetHandler;
    20  import org.as2lib.env.log.repository.LoggerHierarchy;
    21  
    22  /**
    23   * {@code Flex} is intended for configuration of applications compiled with Flex.
    24   * 
    25   * <p>It allows you to define all Flex specific configurations similar to the
    26   * configuration in {@link main.Configuration}.
    27   * 
    28   * <p>The current code uses a common configuration. If you have additional configuration
    29   * you have to overwrite (not extend!) this class in your application directory. The
    30   * only method that must be declared to be compatible is {@link #init}.
    31   * 
    32   * @author Simon Wacker
    33   * @version 1.0
    34   * @see main.Configuration
    35   */
    36  class main.Flex {
    37  	
    38  	/**
    39  	 * Configures the environment.
    40  	 * 
    41  	 * @see org.as2lib.app.conf.FlexApplication
    42  	 */
    43  	public static function init(Void):Void {
    44  		setUpLogging();
    45  	}
    46  	
    47  	/**
    48  	 * Sets up the As2lib Logging API to use Dirk Eisman's Flex Trace Panel.
    49  	 * 
    50  	 * @see <a href="http://www.richinternet.de/blog/index.cfm?entry=EB3BA9D6-A212-C5FA-A9B1B5DB4BB7F555">Flex Trace Panel</a>
    51  	 */
    52  	private static function setUpLogging(Void):Void {
    53  		var root:RootLogger = new RootLogger(RootLogger.ALL);
    54  		root.addHandler(new RichInternetHandler());
    55  		LogManager.setLoggerRepository(new LoggerHierarchy(root)); 
    56  	}
    57  	
    58  }