Class Log
A log object which will collect log entries for another ojbect
Package: Api.Js.SxcJs
Properties
entries
List of all entries added to this log
Declaration
entries: LogEntry[]
Property Value
Type | Description |
---|---|
LogEntry[] |
maxEntries
Maximum amount of entries to add - to prevent memory hoging
Declaration
maxEntries: number
Property Value
Type | Description |
---|---|
number |
name
The name of this log, for scenarios where multiple loggers are mixed
Declaration
name: string
Property Value
Type | Description |
---|---|
string |
Methods
add(() => string | string, unknown)
Add a simple message to the log
Declaration
function add(message: () => string | string, data?: unknown)
Parameters
Type | Name | Description |
---|---|---|
() => string | string | message |
preferred usage is with string parameter:
log.add( in case that we experience error with normal string parameter, we can use arrow function to enclose parameter like this () => parameter
but use it very rarely, because there is certainly a performance implication!
log.add( |
unknown | data |
Returns
Type | Description |
---|---|
string |