new Logger(className, options)
Creates a new Logger instance
Name | Type | Default | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
className |
string |
The Class name associated with the logging instance |
|||||||||||||
options |
object | null |
optional
Optional settings.
|
Methods
-
staticLogger.currentLogger(){Logger~loggerCallback}
-
Get the current logger function
-
staticLogger.filter(type, values){null}
-
Set what classes to log.
Name Type Description type
string The type of filter (currently only class)
values
Array.<string> The filters to apply
-
staticLogger.reset(){null}
-
Resets the logger to default settings, error and no filtered classes
-
staticLogger.setCurrentLogger(logger){null}
-
Set the current logger function
Name Type Description logger
Logger~loggerCallback Logger function.
-
staticLogger.setLevel(level){null}
-
Set the current log level
Name Type Description level
string Set current log level (debug, info, error)
-
debug(message, object){null}
-
Log a message at the debug level
Name Type Description message
string The message to log
object
object additional meta data to log
Type Definitions
-
loggerCallback(msg, state)
-
Name Type Description msg
string message being logged
state
object an object containing more metadata about the logging message