Class: Logger

Logger

new Logger(conn, name, relevance, basicExtra)

Logger.js, line 15

Use it to ease logging multiple times with the same name, relevance and some extra keys Logs created this way will have the time field set as the elapsed time (in ms) between creation by Connection#getLogger and subsequent calls to its methods. Keys on the basicExtra parameter will be assigned to the extra object passed when calling Logger methods.

Name Type Description
conn Connection
name string
relevance Connection#RELEVANCE optional
basicExtra Object optional

Members

nullablebasicExtraObject

Binded keys/values for extra

Parent connection

namestring

Binded name value

nullablerelevanceConnection#RELEVANCE

Binded relevance value

thennumber

The timestamp (in ms) when it was created

Methods

debug(message, extra)

Logger.js, line 57

Simpler way for Connection#sendLog with level set as DEBUG

Name Type Description
message string | Error optional
extra * optional

any JSON-compatible value

error(message, extra)

Logger.js, line 84

Simpler way for Connection#sendLog with level set as ERROR

Name Type Description
message string | Error optional
extra * optional

any JSON-compatible value

fatal(message, extra)

Logger.js, line 93

Simpler way for Connection#sendLog with level set as FATAL

Name Type Description
message string | Error optional
extra * optional

any JSON-compatible value

info(message, extra)

Logger.js, line 66

Simpler way for Connection#sendLog with level set as INFO

Name Type Description
message string | Error optional
extra * optional

any JSON-compatible value

warn(message, extra)

Logger.js, line 75

Simpler way for Connection#sendLog with level set as WARN

Name Type Description
message string | Error optional
extra * optional

any JSON-compatible value