Earl::Logger
Requires Earl.application to be started. Otherwise logged messages will
hang the current program when the logger mailbox is full!
Extension module:
Include in agents to add a single #log method to access Log methods for
the current agent. The methods eventually delegate to Logger class methods.
Configuration:
#level=—change theSeveritylevel (default:Severity::INFO).#backends—add or remove backends (default:ConsoleBackend).
The configuration may be changed at any time, but we advise to configure
once before starting Earl.application.
Custom backends:
Custom backends must inherit from Backend and implement the
Backend#write abstract method.
Class methods
The list of currently enabled backends. Can be modified to add, remove or
configure backends, but must be done before starting Earl.application.
Custom backends must inherit from Backend.
Logs message if debug? returns true.
Logs the message returned by the block if debug? returns
true, otherwise the block is never invoked.
Returns true if the current level is DEBUG or lower.
Logs message if error? returns true.
Logs the message returned by the block if error? returns
true, otherwise the block is never invoked.
Returns true if the current level is ERROR or lower.
Logs message if info? returns true.
Logs the message returned by the block if info? returns
true, otherwise the block is never invoked.
Returns true if the current level is INFO or lower.
Configures the severity level. Can be changed at any time.
Returns true if the current level is SILENT.
Logs message if warn? returns true.
Logs the message returned by the block if warn? returns
true, otherwise the block is never invoked.
Returns true if the current level is WARN or lower.