| Package | org.as3commons.logging.api |
| Interface | public interface ILogger |
| Implementors | Logger |
ILogger defines the public access for any kind of logging
request.
ILogger offers the common methods to log your traces like
debug, info, warning, error,
fatal. Each of these methods gets treated separately by the
logging framework.
Performance Note: If you have a log statement that does intense processing or intense stringification it will be executed no matter if a log target is actually in place.
// This will call the complexStringifcation no matter if it will do actually
// something.
logger.info( complexStringification() );
if( logger.infoEnabled ) {
// will just call the stringification in case the info is enabled
logger.info( complexStringification() );
}
See also
| Property | Defined By | ||
|---|---|---|---|
| debugEnabled : Boolean [read-only]
true if debug actually does something. | ILogger | ||
| errorEnabled : Boolean [read-only]
true if error actually does something. | ILogger | ||
| fatalEnabled : Boolean [read-only]
true if fatal works. | ILogger | ||
| infoEnabled : Boolean [read-only]
true if info actually does something. | ILogger | ||
| name : String [read-only]
Getter for the name this instance. | ILogger | ||
| person : String [read-only]
Returns the person that this logger created. | ILogger | ||
| shortName : String [read-only]
Returns the short form of the name. | ILogger | ||
| warnEnabled : Boolean [read-only]
true if warn actually does something. | ILogger | ||
| Method | Defined By | ||
|---|---|---|---|
debug(message:*, parameters:Array = null):void
Logs a message for debug purposes. | ILogger | ||
error(message:*, parameters:Array = null):void
Logs a message to notify about an error that was dodged by the application. | ILogger | ||
fatal(message:*, parameters:Array = null):void
Logs a message to notify about an error that broke the application and
couldn't be fixed automatically. | ILogger | ||
info(message:*, parameters:Array = null):void
Logs a message for notification purposes. | ILogger | ||
warn(message:*, parameters:Array = null):void
Logs a message for warning about a undesirable application state. | ILogger | ||
| debugEnabled | property |
debugEnabled:Boolean [read-only]
true if debug actually does something.
public function get debugEnabled():BooleanSee also
| errorEnabled | property |
errorEnabled:Boolean [read-only]
true if error actually does something.
public function get errorEnabled():BooleanSee also
| fatalEnabled | property |
fatalEnabled:Boolean [read-only]
true if fatal works.
public function get fatalEnabled():BooleanSee also
| infoEnabled | property |
infoEnabled:Boolean [read-only]
true if info actually does something.
public function get infoEnabled():BooleanSee also
| name | property |
name:String [read-only] Getter for the name this instance.
public function get name():String| person | property |
person:String [read-only] Returns the person that this logger created.
For person based log statements loggers contain a optional information that can be used to filter for persons that created the logggers
public function get person():String| shortName | property |
shortName:String [read-only] Returns the short form of the name.
The name of a ILogger is usually [package].[class]. The
short name contains only the name of [class], in other words: the content
after the last ".".
public function get shortName():StringSee also
com.some.MyClass then the short
name is MyClass.
| warnEnabled | property |
warnEnabled:Boolean [read-only]
true if warn actually does something.
public function get warnEnabled():BooleanSee also
| debug | () | method |
public function debug(message:*, parameters:Array = null):voidLogs a message for debug purposes.
Debug messages should be messages that are additional output used to ease the debugging of an application.
A message can contain place holders that are filled with the additional
parameters. The ILogTarget implementation may treat the
options as they want.
Example for a message with parameters:
logger.debug("A: {0} is B: {1}", "Hello", "World");
// A: Hello is B: World
Parameters
message:* — Message that should be logged.
| |
parameters:Array (default = null) — List of parameters.
|
| error | () | method |
public function error(message:*, parameters:Array = null):voidLogs a message to notify about an error that was dodged by the application.
The Error level is designated to be used in case an error occurred and the error could be dodged. It should contain hints about why that error occurs and if there is a common case where this error occurs.
A message can contain place holders that are filled with the additional
parameters. The ILogTarget implementation may treat the
options as they want.
Example for a message with parameters:
logger.error("A: {0} is B: {1}", "Hello", "World");
// A: Hello is B: World
Parameters
message:* — Message that should be logged.
| |
parameters:Array (default = null) — List of parameters.
|
| fatal | () | method |
public function fatal(message:*, parameters:Array = null):voidLogs a message to notify about an error that broke the application and couldn't be fixed automatically.
The Fatal level is designated to be used in case an error occurred that couldn't be stopped. A fatal error usually results in a inconsistent or inperceivable application state.
A message can contain place holders that are filled with the additional
parameters. The ILogTarget implementation may treat the
options as they want.
Example for a message with parameters:
logger.fatal("A: {0} is B: {1}", "Hello", "World");
// A: Hello is B: World
Parameters
message:* — Message that should be logged.
| |
parameters:Array (default = null) — List of parameters.
|
| info | () | method |
public function info(message:*, parameters:Array = null):voidLogs a message for notification purposes.
Notification messages should be messages that highlight interesting informations about what happens in the the application.
A message can contain place holders that are filled with the additional
parameters. The ILogTarget implementation may treat the
options as they want.
Example for a message with parameters:
logger.info("A: {0} is B: {1}", "Hello", "World");
// A: Hello is B: World
Parameters
message:* — Message that should be logged.
| |
parameters:Array (default = null) — List of parameters.
|
| warn | () | method |
public function warn(message:*, parameters:Array = null):voidLogs a message for warning about a undesirable application state.
Warnings are designated to be used in case code got executed that is not desirable for performance, memory or clarity reasons but didn't result in any error.
A message can contain place holders that are filled with the additional
parameters. The ILogTarget implementation may treat the
options as they want.
Example for a message with parameters:
logger.warn("A: {0} is B: {1}", "Hello", "World");
// A: Hello is B: World
Parameters
message:* — Message that should be logged.
| |
parameters:Array (default = null) — List of parameters.
|