Constructor
new @ui5/logger/Logger(moduleName)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
moduleName |
string | Identifier for messages created by this logger.
Example: module:submodule:Class |
Members
LOG_EVENT_NAME :string
- Description:
- Event name used for emitting new log-message event on the
process
object
- Event name used for emitting new log-message event on the
- Source:
Event name used for emitting new log-message event on the
process
object
Type:
- string
LOG_LEVELS :Array.<string>
- Description:
- Available log levels, ordered by priority:
- silly
- verbose
- perf
- info (default)
- warn
- error
- silent
silent
is special in the sense that no messages can be submitted with that level. It can be used to suppress all logging.
- Available log levels, ordered by priority:
- Source:
Available log levels, ordered by priority:
- silly
- verbose
- perf
- info (default)
- warn
- error
- silent
silent
is special in the sense that no messages can be submitted with that level.
It can be used to suppress all logging.
Type:
- Array.<string>
Methods
error(…message)
- Description:
- Create a log entry with the
error
level
- Create a log entry with the
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
any |
<repeatable> |
Messages to log. An automatic string conversion is applied if necessary |
info(…message)
- Description:
- Create a log entry with the
info
level
- Create a log entry with the
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
any |
<repeatable> |
Messages to log. An automatic string conversion is applied if necessary |
isLevelEnabled(levelName) → {boolean}
- Description:
- Tests whether the provided log level is enabled by the current log level
- Source:
Parameters:
Name | Type | Description |
---|---|---|
levelName |
string | Log level to test |
Returns:
True if the provided level is enabled
- Type
- boolean
perf(…message)
- Description:
- Create a log entry with the
perf
level
- Create a log entry with the
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
any |
<repeatable> |
Messages to log. An automatic string conversion is applied if necessary |
silly(…message)
- Description:
- Create a log entry with the
silly
level
- Create a log entry with the
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
any |
<repeatable> |
Messages to log. An automatic string conversion is applied if necessary |
verbose(…message)
- Description:
- Create a log entry with the
verbose
level
- Create a log entry with the
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
any |
<repeatable> |
Messages to log. An automatic string conversion is applied if necessary |
warn(…message)
- Description:
- Create a log entry with the
warn
level
- Create a log entry with the
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
any |
<repeatable> |
Messages to log. An automatic string conversion is applied if necessary |
(static) getLevel() → {string}
- Description:
- Gets the current log level
- Source:
Returns:
The current log level. Defaults to
info
- Type
- string
(static) isLevelEnabled(levelName) → {boolean}
- Description:
- Tests whether the provided log level is enabled by the current log level
- Source:
Parameters:
Name | Type | Description |
---|---|---|
levelName |
string | Log level to test |
Returns:
True if the provided level is enabled
- Type
- boolean
(static) setLevel(levelName)
- Description:
- Sets the standard log level.
Example: Setting it toperf
would suppress allsilly
andverbose
logging, and only showperf
,info
,warn
anderror
logs.
- Sets the standard log level.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
levelName |
string | New log level |