Class: LogRecord

timapi.LogRecord

Log record. Contains all fields of a log entry.

Notes for how logging can be customized in timapi:

  • The function "onTimApiLog(message)" can be defined, which will receive a string-message for each log-entry. If not defined, all log messages will automatically be logged to the console.
  • In order to control which and how log-messages are processed "onTimApiPublishLogRecord(logRecord)" can be defined. This function will receive single log entries of type "timapi.LogRecord". One can e.g. filter logs only of loglevel "severe". In the end, this customized function should call "timapi.log(message)" with a customized string log message.

Classes

LogLevel

Overview

Members-Overview

Methods-Overview

Member-List

file :String

File where log originates from

level :timapi.LogRecord.LogLevel

Level of log-record

line :Number

Line where log originates from

message :String

Log Message

method :String

Method where log originates from

parameters :Array.<String>

If available: list of given parameters

stackTrace :Array.<timapi.LogRecordTrace>

Stack trace

thread :String

Thread id

timestamp :Date

Timestamp of log

Methods

matchesLevel(requiredLogLevel) → {boolean}

Checks if a log level of record matches required log level. Used to filter log records. Returns true if the record level is the same as requiredLogLevel or record level is listed above requiredLogLevel in the enumeration.
Parameters:
Name Type Description
requiredLogLevel timapi.LogRecord.LogLevel Loglevel that is required.
Returns:
True if record level matches required log level.

Type: boolean

toString()

Format record for output in debug logs. The default onTimApiPublishLogRecord uses this method to format the log record before sending it to timapi.log().