An object that writes trace messages into the hosting application's tracing system.
The trace messages are logged at levels in the following order (from low to high):
For example, traces logged with the warning
method will be traced if the trace settings are at "Warning" level or higher.
However if the trace setting is at "Error", the message will not be logged.
To help save disk space, use a format string with {}
as the placeholders. Do not use string concatenation.
When the messages are read, the message will be interpolated with the actual values.
// Bad example - please do not repeat this pattern
trace.warning("The value is " + 27);
// Good example
trace.warning("The value is {}", 27);
Methods
always(message[, ...args])
Always traces the specified message, regardless of trace level settings.
Parameters
Name | Type | Description |
---|---|---|
message | String |
The message or message format string. |
args | Any |
One or more formatting arguments to pass for message formatting. Each value will be converted to a |
error(message[, ...args])
Traces the specified message at the Error trace level.
Parameters
Name | Type | Description |
---|---|---|
message | String |
The message or message format string. |
args | Any |
One or more formatting arguments to pass for message formatting. Each value will be converted to a |
note(message[, ...args])
Traces the specified message at the Note trace level.
Parameters
Name | Type | Description |
---|---|---|
message | String |
The message or message format string. |
args | Any |
One or more formatting arguments to pass for message formatting. Each value will be converted to a |
status(message[, ...args])
Traces the specified message at the Status trace level.
Parameters
Name | Type | Description |
---|---|---|
message | String |
The message or message format string. |
args | Any |
One or more formatting arguments to pass for message formatting. Each value will be converted to a |
verbose(message[, ...args])
Traces the specified message at the Verbose trace level.
Parameters
Name | Type | Description |
---|---|---|
message | String |
The message or message format string. |
args | Any |
One or more formatting arguments to pass for message formatting. Each value will be converted to a |
warning(message[, ...args])
Traces the specified message at the Warning trace level.
Parameters
Name | Type | Description |
---|---|---|
message | String |
The message or message format string. |
args | Any |
One or more formatting arguments to pass for message formatting. Each value will be converted to a |