Package | org.spicefactory.lib.logging |
Interface | public interface SpiceLogFactory extends LogFactory |
Implementors | DefaultLogFactory |
LogFactory
is responsible for creating and caching Logger
instances
and offers configuration options for setting log levels and adding Appender
instances.
Usually you would not use this interface in application code except for startup logic that configures
the factory. The default way to obtain Logger
instances is the static
LogContext.getLogger
method of the Spicelib Log Wrapper.
Method | Defined By | ||
---|---|---|---|
addAppender(app:Appender):void
Adds the specified Appender to this LogFactory. | SpiceLogFactory | ||
addLogLevel(name:Object, level:LogLevel):void
Adds the specified level for the given logger name. | SpiceLogFactory | ||
Returns the logger for the specified name. | LogFactory | ||
refresh():void
Refreshes all existing Logger instances. | SpiceLogFactory | ||
setRootLogLevel(level:LogLevel):void
Sets the root log level for this factory. | SpiceLogFactory |
addAppender | () | method |
public function addAppender(app:Appender):void
Adds the specified Appender to this LogFactory. Any Logger
instances that have already been created will register with this new Appender
without the need to call refresh
.
Parameters
app:Appender — the Appender instance to add to this LogFactory
|
addLogLevel | () | method |
public function addLogLevel(name:Object, level:LogLevel):void
Adds the specified level for the given logger name. The levels are organized in a hierarchical way, so if you specify a level for a logger name "com.mycompany" it is in effect for all names that start with that substring like "com.mycompany.mypackage.MyClass" except for those that have their own level set explicitly.
If the name parameter is a Class
instance, the fully qualified class name will be used. Otherwise the toString
method will be invoked on the given name instance.
Parameters
name:Object — the name of the logger to set the level for
| |
level:LogLevel — the level to set for the specified logger name
|
refresh | () | method |
public function refresh():void
Refreshes all existing Logger
instances. This might be necessary
if you change the configuration with addLogLevel
or setRootLogLevel
after one or more Logger
instances have already been created.
setRootLogLevel | () | method |
public function setRootLogLevel(level:LogLevel):void
Sets the root log level for this factory. The root log level specifies the log level to use for all Logger instances that don't have their own level set explicitly.
Parameters
level:LogLevel |