Logger
6.9.0The Logger API enables JavaScript applications to create a hierarchy of sub-loggers mapped to application components
where you can control the level of logging for each component. You can also route the output of log messages (depending on the logging level)
to a variety of targets - the developer console or an external output (usually a rolling file on the desktop, but actually any target the log4net
library supports).
The Logger API is accessible through the io.logger
object.
APIobject
Properties
Property | Type | Default | Required | Description |
---|---|---|---|---|
name | string | Name of the logger. |
||
version | string | Version of the Logging API. |
Methods
canPublishmethod
consoleLevelmethod
debugmethod
Signature
(message: string) => void
Description
Method for logging messages at "debug" level.
Parameters
Name | Type | Required | Description |
---|---|---|---|
message | string | Message to log. |
errormethod
Signature
(message: string, err?: Error) => void
Description
Method for logging messages at "error" level.
Parameters
Name | Type | Required | Description |
---|---|---|---|
message | string | Message to log. |
|
err | Error |
infomethod
Signature
(message: string) => void
Description
Method for logging messages at "info" level.
Parameters
Name | Type | Required | Description |
---|---|---|---|
message | string | Message to log. |
logmethod
publishLevelmethod
subLoggermethod
Signature
(name: string) => API
Description
Creates a new logger which is a sub-logger of the current one.
Parameters
Name | Type | Required | Description |
---|---|---|---|
name | string | Name for the sub-logger. |
tracemethod
Signature
(message: string) => void
Description
Method for logging messages at "trace" level.
Parameters
Name | Type | Required | Description |
---|---|---|---|
message | string | Message to log. |
warnmethod
Signature
(message: string) => void
Description
Method for logging messages at "warn" level.
Parameters
Name | Type | Required | Description |
---|---|---|---|
message | string | Message to log. |
LogLevelenumeration
Description
- "off"
- "trace"
- "debug"
- "info"
- "warn"
- "error"