Skip to main content

@terascope/job-components / index / Logger

Class: Logger

Defined in: packages/types/dist/src/logger.d.ts:3

Extends

  • EventEmitter

Constructors

new Logger()

new Logger(options): Logger

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

Parameters

ParameterType
optionsLoggerOptions

Returns

Logger

Overrides

EventEmitter.constructor

Properties

PropertyTypeDescriptionDefined in
fieldsany-packages/types/dist/src/logger.d.ts:18
srcboolean-packages/types/dist/src/logger.d.ts:19
streamsinternal | WritableStream<any> | undefined[]Terafoundation specificpackages/types/dist/src/logger.d.ts:17

Methods

addSerializers()

addSerializers(serializers): void

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

Parameters

ParameterType
serializersSerializers

Returns

void


addStream()

addStream(stream): void

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

Parameters

ParameterType
streamStream

Returns

void


child()

child(options, simple?): Logger

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

Parameters

ParameterType
optionsRecord<string, any>
simple?boolean

Returns

Logger


debug()

Call Signature

debug(): boolean

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

Returns a boolean: is the debug level enabled?

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

Returns

boolean

Call Signature

debug(error, ...params): void

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

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

Call Signature

debug(obj, ...params): void

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

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

Call Signature

debug(format, ...params): void

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

Uses util.format for msg formatting.

Parameters
ParameterType
formatany
...paramsany[]
Returns

void


error()

Call Signature

error(): boolean

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

Returns a boolean: is the error level enabled?

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

Returns

boolean

Call Signature

error(error, ...params): void

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

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

Call Signature

error(obj, ...params): void

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

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

Call Signature

error(format, ...params): void

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

Uses util.format for msg formatting.

Parameters
ParameterType
formatany
...paramsany[]
Returns

void


fatal()

Call Signature

fatal(): boolean

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

Returns a boolean: is the fatal level enabled?

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

Returns

boolean

Call Signature

fatal(error, ...params): void

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

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

Call Signature

fatal(obj, ...params): void

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

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

Call Signature

fatal(format, ...params): void

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

Uses util.format for msg formatting.

Parameters
ParameterType
formatany
...paramsany[]
Returns

void


flush()

flush(): Promise<boolean>

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

Terafoundation specific, flush the logs

Returns

Promise<boolean>


info()

Call Signature

info(): boolean

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

Returns a boolean: is the info level enabled?

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

Returns

boolean

Call Signature

info(error, ...params): void

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

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

Call Signature

info(obj, ...params): void

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

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

Call Signature

info(format, ...params): void

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

Uses util.format for msg formatting.

Parameters
ParameterType
formatany
...paramsany[]
Returns

void


level()

Call Signature

level(): number

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

Returns

number

Call Signature

level(value): void

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

Parameters
ParameterType
valueLogLevel
Returns

void


levels()

Call Signature

levels(): number[]

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

Returns

number[]

Call Signature

levels(name): number

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

Parameters
ParameterType
namestring | number
Returns

number

Call Signature

levels(name, value): void

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

Parameters
ParameterType
namestring | number
valueLogLevel
Returns

void


reopenFileStreams()

reopenFileStreams(): void

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

Returns

void


trace()

Call Signature

trace(): boolean

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

Returns a boolean: is the trace level enabled?

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

Returns

boolean

Call Signature

trace(error, ...params): void

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

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

Call Signature

trace(obj, ...params): void

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

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

Call Signature

trace(format, ...params): void

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

Uses util.format for msg formatting.

Parameters
ParameterType
formatany
...paramsany[]
Returns

void


warn()

Call Signature

warn(): boolean

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

Returns a boolean: is the warn level enabled?

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

Returns

boolean

Call Signature

warn(error, ...params): void

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

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

Call Signature

warn(obj, ...params): void

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

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

Call Signature

warn(format, ...params): void

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

Uses util.format for msg formatting.

Parameters
ParameterType
formatany
...paramsany[]
Returns

void