Class: EventLog

EventLog()

A utility class for recording events and grouping by context. Allows logging of events with a descriptive name and severity levels, and provides access to the current analytics service.

Constructor

new EventLog()

Since:
  • 2.34.0
Source:

Members

analytics

Get the analytics model currently available to the event log.
Since:
  • 2.39.0
Source:

Methods

consoleLog(message, logNameopt, levelopt, metaopt)

Log an event to the console with a prefix indicating the log name.
Parameters:
Name Type Attributes Default Description
message string The log message
logName object <optional>
Default Log The log object containing the log name
level "info" | "warning" | "error" <optional>
info The log level
meta object <optional>
Optional metadata to include with the log
Source:

getOrCreateLog(name) → {object}

Create a new collection to record events related by context or scope. If a log with the same name already exists, it will return the existing log.
Parameters:
Name Type Description
name string Label and ID for the log. If not provided, the default log will be used.
Source:
Returns:
- The log object containing an ID, name, start time, and events.
Type
object

log(log, level, message, metaopt)

Record an event to the specified log with a given level.
Parameters:
Name Type Attributes Description
log object The log object to record the event in
level "info" | "warning" | "error" Log level, must be in LEVELS
message string The log message
meta object <optional>
Optional metadata to include with the log
Source:

setConsoleLogLevel(level)

Set the console log level for this EventLog instance.
Parameters:
Name Type Description
level string | boolean The log level to set. Must be one of the LEVELS (info, warning, error) or false to disable console logging.
Source:
Throws:
If an invalid level is provided.
Type
Error

EventLog(options)

new EventLog(options)

Constructor for EventLog
Parameters:
Name Type Description
options object Options for the event log
Properties
Name Type Attributes Description
consoleLevel string <optional>
The level at which to log to the events to the console. Must be one of the LEVELS or false to prevent all console logging.
analyticsModel Backbone.Model <optional>
An existing analytics model to use for sending events. If not provided, the current app analytics model or a no-op Analytics model will be used.
maxEvents number <optional>
Maximum number of events per log. Defaults to 500.
Source:

Members

analytics

Get the analytics model currently available to the event log.
Since:
  • 2.39.0
Source:

Methods

consoleLog(message, logNameopt, levelopt, metaopt)

Log an event to the console with a prefix indicating the log name.
Parameters:
Name Type Attributes Default Description
message string The log message
logName object <optional>
Default Log The log object containing the log name
level "info" | "warning" | "error" <optional>
info The log level
meta object <optional>
Optional metadata to include with the log
Source:

getOrCreateLog(name) → {object}

Create a new collection to record events related by context or scope. If a log with the same name already exists, it will return the existing log.
Parameters:
Name Type Description
name string Label and ID for the log. If not provided, the default log will be used.
Source:
Returns:
- The log object containing an ID, name, start time, and events.
Type
object

log(log, level, message, metaopt)

Record an event to the specified log with a given level.
Parameters:
Name Type Attributes Description
log object The log object to record the event in
level "info" | "warning" | "error" Log level, must be in LEVELS
message string The log message
meta object <optional>
Optional metadata to include with the log
Source:

setConsoleLogLevel(level)

Set the console log level for this EventLog instance.
Parameters:
Name Type Description
level string | boolean The log level to set. Must be one of the LEVELS (info, warning, error) or false to disable console logging.
Source:
Throws:
If an invalid level is provided.
Type
Error