//////////////////////////////////////////////////////////////////////////////// // // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. // The ASF licenses this file to You under the Apache License, Version 2.0 // (the "License"); you may not use this file except in compliance with // the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // //////////////////////////////////////////////////////////////////////////////// package mx.logging { import flash.events.Event; /** * Represents the log information for a single logging event. * The loging system dispatches a single event each time a process requests * information be logged. * This event can be captured by any object for storage or formatting. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public class LogEvent extends Event { include "../core/Version.as"; //-------------------------------------------------------------------------- // // Class constants // //-------------------------------------------------------------------------- /** * Event type constant; identifies a logging event. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public static const LOG:String = "log"; //-------------------------------------------------------------------------- // // Class methods // //-------------------------------------------------------------------------- /** * Returns a string value representing the level specified. * * @param The level a string is desired for. * * @return The level specified in English. * * @langversion 3.0 * @playerversion Flash 9 * @playerversion AIR 1.1 * @productversion Flex 3 */ public static function getLevelString(value:uint):String { switch (value) { case LogEventLevel.INFO: { return "INFO"; } case LogEventLevel.DEBUG: { return "DEBUG"; } case LogEventLevel.ERROR: { return "ERROR"; } case LogEventLevel.WARN: { return "WARN"; } case LogEventLevel.FATAL: { return "FATAL"; } case LogEventLevel.ALL: { return "ALL"; } } return "UNKNOWN"; } //-------------------------------------------------------------------------- // // Constructor // //-------------------------------------------------------------------------- /** * Constructor. * * @param msg String containing the log data. * * @param level The level for this log event. * Valid values are: *
LogEventLevel.FATAL
designates events that are very
* harmful and will eventually lead to application failureLogEventLevel.ERROR
designates error events that might
* still allow the application to continue running.LogEventLevel.WARN
designates events that could be
* harmful to the application operationLogEventLevel.INFO
designates informational messages
* that highlight the progress of the application at
* coarse-grained level.LogEventLevel.DEBUG
designates informational
* level messages that are fine grained and most helpful when
* debugging an application.LogEventLevel.ALL
intended to force a target to
* process all messages.LogEventLogEventLevel.INFO
designates informational messages
* that highlight the progress of the application at
* coarse-grained level.LogEventLevel.DEBUG
designates informational
* level messages that are fine grained and most helpful when
* debugging an application.LogEventLevel.ERROR
designates error events that might
* still allow the application to continue running.LogEventLevel.WARN
designates events that could be
* harmful to the application operation.LogEventLevel.FATAL
designates events that are very
* harmful and will eventually lead to application failure.