new Logger(className, options){Logger}
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.
|
Returns:
Logger instance.Methods
-
staticLogger.currentLogger(){function}
-
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
function 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
-
error(message, object){null}
-
Log a message at the error level
Name Type Description message
string The message to log
object
object additional meta data to log
-
info(message, object){null}
-
Log a message at the info level
Name Type Description message
string The message to log
object
object additional meta data to log
-
isDebug(){boolean}
-
Is the logger set at debug level
-
isError(){boolean}
-
Is the logger set at error level
-
isInfo(){boolean}
-
Is the logger set at info level
-
isWarn(){boolean}
-
Is the logger set at error level