Fields
-
<static, constant> LEVEL_ERROR
-
Log level error
- Source:
-
<static, constant> LEVEL_INFO
-
Log level info
- Source:
-
<static, constant> LEVEL_LOG
-
Log level - general message
- Source:
-
<static, constant> LEVEL_NONE
-
Log level none
- Source:
-
<static, constant> LEVEL_WARN
-
Log level warning
- Source:
Methods
-
<static> error(args)
-
Writes an error message.
Parameters:
Name Type Description args
Object | string The method supports a variable number of arguments, string substitutions and accepts a function as a parameter. See examples in the overview section above. - Source:
-
<static> info(args)
-
Writes an informational message.
Parameters:
Name Type Description args
Object | string The method supports a variable number of arguments, string substitutions and accepts a function as a parameter. See examples in the overview section above. - Source:
-
<static> log(args)
-
Writes a general message.
Parameters:
Name Type Description args
Object | string The method supports a variable number of arguments, string substitutions and accepts a function as a parameter. See examples in the overview section above. - Source:
-
<static> option(key, value)
-
Method for setting and getting logger option/options
Sets/gets logger configuration - level and/or writer. Accepts variable number of arguments.
Defaults:
Default level: oj.Logger.LEVEL_ERROR
Default writer: null; writes to the consoleUsages:
oj.Logger.option(optionName) gets the value associated the the specified optionName
oj.Logger.option() gets an object containing key/value pairs representing the logger options hash
oj.Logger.option(optionName, value) sets the option value associated with optionName
oj.Logger.option(options) sets one or more options for the loggerParameters:
Name Type Argument Description key
Object | string <optional>
value
Object | string <optional>
- Source:
Example
Overriding default options
oj.Logger.option("level", oj.Logger.LEVEL_INFO); oj.Logger.option("writer", customWriter); //an object that implements the following methods: log(), info(), warn(), error()
-
<static> warn(args)
-
Writes a warning message.
Parameters:
Name Type Description args
Object | string The method supports a variable number of arguments, string substitutions and accepts a function as a parameter. See examples in the overview section above. - Source: