LogSupport
can be used to easily gain access to loggers.
You may extend this class to be able to access the logger appropriate to
your specific class with the getter property logger or the getLogger
method.
Example:
class MyClass extends LogSupport {
public function test() {
logger.info("hi");
}
}
new LogSupport()
static public function getLoggerByScope(scope):Logger
Returns the logger for the given scope
.
scope | the scope to return a logger for |
the logger corresponding to the given scope
static public function getLoggerByInstance(instance):Logger
Return the logger for the given instance
.
instance | the instance to return a logger for |
the logger corresponding to the given instance
static public function getLoggerByClass(clazz:Function):Logger
Returns the logger for the given clazz
.
clazz | the clazz to return a logger for |
the logger corresponding to the given clazz
public function getLogger(Void):Logger
Returns the logger for this instance.
the logger corresponding to this instance