Skip to main content

@terascope/job-components / index / Logger

Class: Logger

Extends

  • EventEmitter

Constructors

new Logger()

new Logger(options): Logger

Parameters

ParameterType
optionsLoggerOptions

Returns

Logger

Overrides

EventEmitter.constructor

Source

packages/types/dist/src/logger.d.ts:4

Properties

fields

fields: any

Source

packages/types/dist/src/logger.d.ts:18


src

src: boolean

Source

packages/types/dist/src/logger.d.ts:19


streams

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

Terafoundation specific

Source

packages/types/dist/src/logger.d.ts:17

Methods

addSerializers()

addSerializers(serializers): void

Parameters

ParameterType
serializersSerializers

Returns

void

Source

packages/types/dist/src/logger.d.ts:6


addStream()

addStream(stream): void

Parameters

ParameterType
streamStream

Returns

void

Source

packages/types/dist/src/logger.d.ts:5


child()

child(options, simple?): Logger

Parameters

ParameterType
optionsRecord<string, any>
simple?boolean

Returns

Logger

Source

packages/types/dist/src/logger.d.ts:7


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

packages/types/dist/src/logger.d.ts:50

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

packages/types/dist/src/logger.d.ts:57

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

packages/types/dist/src/logger.d.ts:65

debug(format, params)

debug(format, ...params): void

Uses util.format for msg formatting.

Parameters
ParameterType
formatany
...paramsany[]
Returns

void

Source

packages/types/dist/src/logger.d.ts:69


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

packages/types/dist/src/logger.d.ts:125

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

packages/types/dist/src/logger.d.ts:132

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

packages/types/dist/src/logger.d.ts:140

error(format, params)

error(format, ...params): void

Uses util.format for msg formatting.

Parameters
ParameterType
formatany
...paramsany[]
Returns

void

Source

packages/types/dist/src/logger.d.ts:144


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

packages/types/dist/src/logger.d.ts:150

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

packages/types/dist/src/logger.d.ts:157

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

packages/types/dist/src/logger.d.ts:165

fatal(format, params)

fatal(format, ...params): void

Uses util.format for msg formatting.

Parameters
ParameterType
formatany
...paramsany[]
Returns

void

Source

packages/types/dist/src/logger.d.ts:169


flush()

flush(): Promise<boolean>

Terafoundation specific, flush the logs

Returns

Promise<boolean>

Source

packages/types/dist/src/logger.d.ts:173


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

packages/types/dist/src/logger.d.ts:75

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

packages/types/dist/src/logger.d.ts:82

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

packages/types/dist/src/logger.d.ts:90

info(format, params)

info(format, ...params): void

Uses util.format for msg formatting.

Parameters
ParameterType
formatany
...paramsany[]
Returns

void

Source

packages/types/dist/src/logger.d.ts:94


level()

level()

level(): number

Returns

number

Source

packages/types/dist/src/logger.d.ts:9

level(value)

level(value): void

Parameters
ParameterType
valueLogLevel
Returns

void

Source

packages/types/dist/src/logger.d.ts:10


levels()

levels()

levels(): number[]

Returns

number[]

Source

packages/types/dist/src/logger.d.ts:11

levels(name)

levels(name): number

Parameters
ParameterType
namestring | number
Returns

number

Source

packages/types/dist/src/logger.d.ts:12

levels(name, value)

levels(name, value): void

Parameters
ParameterType
namestring | number
valueLogLevel
Returns

void

Source

packages/types/dist/src/logger.d.ts:13


reopenFileStreams()

reopenFileStreams(): void

Returns

void

Source

packages/types/dist/src/logger.d.ts:8


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

packages/types/dist/src/logger.d.ts:25

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

packages/types/dist/src/logger.d.ts:32

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

packages/types/dist/src/logger.d.ts:40

trace(format, params)

trace(format, ...params): void

Uses util.format for msg formatting.

Parameters
ParameterType
formatany
...paramsany[]
Returns

void

Source

packages/types/dist/src/logger.d.ts:44


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

packages/types/dist/src/logger.d.ts:100

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

packages/types/dist/src/logger.d.ts:107

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

packages/types/dist/src/logger.d.ts:115

warn(format, params)

warn(format, ...params): void

Uses util.format for msg formatting.

Parameters
ParameterType
formatany
...paramsany[]
Returns

void

Source

packages/types/dist/src/logger.d.ts:119