Skip to main content

@terascope/types / logger / Logger

Class: Logger

Extends

  • EventEmitter

Constructors

new Logger()

new Logger(options): Logger

Parameters

ParameterType
optionsLoggerOptions

Returns

Logger

Overrides

EventEmitter.constructor

Source

logger.ts:13

Properties

fields

fields: any

Source

logger.ts:30


src

src: boolean

Source

logger.ts:31


streams

streams: internal | WritableStream<any> | undefined[]

Terafoundation specific

Source

logger.ts:28

Methods

addSerializers()

addSerializers(serializers): void

Parameters

ParameterType
serializersSerializers

Returns

void

Source

logger.ts:15


addStream()

addStream(stream): void

Parameters

ParameterType
streamStream

Returns

void

Source

logger.ts:14


child()

child(options, simple?): Logger

Parameters

ParameterType
optionsRecord<string, any>
simple?boolean

Returns

Logger

Source

logger.ts:16


debug()

debug()

debug(): boolean

Returns a boolean: is the debug level enabled?

This is equivalent to log.isDebugEnabled() or log.isEnabledFor(DEBUG) in log4j.

Returns

boolean

Source

logger.ts:67

debug(error, params)

debug(error, ...params): void

Special case to log an Error instance to the record. This adds an err field with exception details (including the stack) and sets msg to the exception message or you can specify the msg.

Parameters
ParameterType
errorError
...paramsany[]
Returns

void

Source

logger.ts:75

debug(obj, params)

debug(obj, ...params): void

The first field can optionally be a "fields" object, which is merged into the log record.

To pass in an Error and other fields, use the err field name for the Error instance.

Parameters
ParameterType
objRecord<string, any>
...paramsany[]
Returns

void

Source

logger.ts:84

debug(format, params)

debug(format, ...params): void

Uses util.format for msg formatting.

Parameters
ParameterType
formatany
...paramsany[]
Returns

void

Source

logger.ts:89


error()

error()

error(): boolean

Returns a boolean: is the error level enabled?

This is equivalent to log.isErrorEnabled() or log.isEnabledFor(ERROR) in log4j.

Returns

boolean

Source

logger.ts:154

error(error, params)

error(error, ...params): void

Special case to log an Error instance to the record. This adds an err field with exception details (including the stack) and sets msg to the exception message or you can specify the msg.

Parameters
ParameterType
errorError
...paramsany[]
Returns

void

Source

logger.ts:162

error(obj, params)

error(obj, ...params): void

The first field can optionally be a "fields" object, which is merged into the log record.

To pass in an Error and other fields, use the err field name for the Error instance.

Parameters
ParameterType
objRecord<string, any>
...paramsany[]
Returns

void

Source

logger.ts:171

error(format, params)

error(format, ...params): void

Uses util.format for msg formatting.

Parameters
ParameterType
formatany
...paramsany[]
Returns

void

Source

logger.ts:176


fatal()

fatal()

fatal(): boolean

Returns a boolean: is the fatal level enabled?

This is equivalent to log.isFatalEnabled() or log.isEnabledFor(FATAL) in log4j.

Returns

boolean

Source

logger.ts:183

fatal(error, params)

fatal(error, ...params): void

Special case to log an Error instance to the record. This adds an err field with exception details (including the stack) and sets msg to the exception message or you can specify the msg.

Parameters
ParameterType
errorError
...paramsany[]
Returns

void

Source

logger.ts:191

fatal(obj, params)

fatal(obj, ...params): void

The first field can optionally be a "fields" object, which is merged into the log record.

To pass in an Error and other fields, use the err field name for the Error instance.

Parameters
ParameterType
objRecord<string, any>
...paramsany[]
Returns

void

Source

logger.ts:200

fatal(format, params)

fatal(format, ...params): void

Uses util.format for msg formatting.

Parameters
ParameterType
formatany
...paramsany[]
Returns

void

Source

logger.ts:205


flush()

flush(): Promise<boolean>

Terafoundation specific, flush the logs

Returns

Promise<boolean>

Source

logger.ts:210


info()

info()

info(): boolean

Returns a boolean: is the info level enabled?

This is equivalent to log.isInfoEnabled() or log.isEnabledFor(INFO) in log4j.

Returns

boolean

Source

logger.ts:96

info(error, params)

info(error, ...params): void

Special case to log an Error instance to the record. This adds an err field with exception details (including the stack) and sets msg to the exception message or you can specify the msg.

Parameters
ParameterType
errorError
...paramsany[]
Returns

void

Source

logger.ts:104

info(obj, params)

info(obj, ...params): void

The first field can optionally be a "fields" object, which is merged into the log record.

To pass in an Error and other fields, use the err field name for the Error instance.

Parameters
ParameterType
objRecord<string, any>
...paramsany[]
Returns

void

Source

logger.ts:113

info(format, params)

info(format, ...params): void

Uses util.format for msg formatting.

Parameters
ParameterType
formatany
...paramsany[]
Returns

void

Source

logger.ts:118


level()

level()

level(): number

Returns

number

Source

logger.ts:19

level(value)

level(value): void

Parameters
ParameterType
valueLogLevel
Returns

void

Source

logger.ts:20


levels()

levels()

levels(): number[]

Returns

number[]

Source

logger.ts:21

levels(name)

levels(name): number

Parameters
ParameterType
namestring | number
Returns

number

Source

logger.ts:22

levels(name, value)

levels(name, value): void

Parameters
ParameterType
namestring | number
valueLogLevel
Returns

void

Source

logger.ts:23


reopenFileStreams()

reopenFileStreams(): void

Returns

void

Source

logger.ts:17


trace()

trace()

trace(): boolean

Returns a boolean: is the trace level enabled?

This is equivalent to log.isTraceEnabled() or log.isEnabledFor(TRACE) in log4j.

Returns

boolean

Source

logger.ts:38

trace(error, params)

trace(error, ...params): void

Special case to log an Error instance to the record. This adds an err field with exception details (including the stack) and sets msg to the exception message or you can specify the msg.

Parameters
ParameterType
errorError
...paramsany[]
Returns

void

Source

logger.ts:46

trace(obj, params)

trace(obj, ...params): void

The first field can optionally be a "fields" object, which is merged into the log record.

To pass in an Error and other fields, use the err field name for the Error instance.

Parameters
ParameterType
objRecord<string, any>
...paramsany[]
Returns

void

Source

logger.ts:55

trace(format, params)

trace(format, ...params): void

Uses util.format for msg formatting.

Parameters
ParameterType
formatany
...paramsany[]
Returns

void

Source

logger.ts:60


warn()

warn()

warn(): boolean

Returns a boolean: is the warn level enabled?

This is equivalent to log.isWarnEnabled() or log.isEnabledFor(WARN) in log4j.

Returns

boolean

Source

logger.ts:125

warn(error, params)

warn(error, ...params): void

Special case to log an Error instance to the record. This adds an err field with exception details (including the stack) and sets msg to the exception message or you can specify the msg.

Parameters
ParameterType
errorError
...paramsany[]
Returns

void

Source

logger.ts:133

warn(obj, params)

warn(obj, ...params): void

The first field can optionally be a "fields" object, which is merged into the log record.

To pass in an Error and other fields, use the err field name for the Error instance.

Parameters
ParameterType
objRecord<string, any>
...paramsany[]
Returns

void

Source

logger.ts:142

warn(format, params)

warn(format, ...params): void

Uses util.format for msg formatting.

Parameters
ParameterType
formatany
...paramsany[]
Returns

void

Source

logger.ts:147