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.core.BasicInterface;
    18  import org.as2lib.env.log.LogMessage;
    19  
    20  /**
    21   * {@code LogHandler} is used to actually log messages.
    22   * 
    23   * <p>You need different handlers for different output targets. Output targets can
    24   * be everything, Flash's Output Panel, any type of file, a database, a custom
    25   * output console and so on.
    26   *
    27   * <p>The As2lib supports a hand full of different output formats. Take a look at
    28   * the {@code org.as2lib.env.log.handler} package to see which are supported.
    29   *
    30   * <p>A logger does not have to support the feature of adding custom handlers. It
    31   * is not prescribed by the {@code Logger} interface so it depends on specific
    32   * implementations. Mostly 'speed' loggers do not use this approach because it
    33   * slows the whole logging process a little bit down.
    34   *
    35   * @author Simon Wacker
    36   */
    37  interface org.as2lib.env.log.LogHandler extends BasicInterface {
    38  	
    39  	/**
    40  	 * Writes information obtained from the passed-in {@code message} as well as 
    41  	 * additional information to the output target.
    42  	 * 
    43  	 * <p>It is not prescribed which information will be written. Hence it depends on
    44  	 * the concrete handler.
    45  	 *
    46  	 * <p>Most handlers simply use the {@link LogMessage#toString} method to obtain
    47  	 * the string representation to log.
    48  	 *
    49  	 * @param message the message containing the information to log
    50  	 */
    51  	public function write(message:LogMessage):Void;
    52  	
    53  }