@terascope/job-components / index / Logger
Class: Logger
Extends
EventEmitter
Constructors
new Logger()
new Logger(
options
):Logger
Parameters
Parameter | Type |
---|---|
options | LoggerOptions |
Returns
Overrides
EventEmitter.constructor
Source
packages/types/dist/src/logger.d.ts:7
Properties
fields
fields:
any
Source
packages/types/dist/src/logger.d.ts:21
src
src:
boolean
Source
packages/types/dist/src/logger.d.ts:22
streams
streams:
undefined
[] |internal
|WritableStream
<any
>
Terafoundation specific
Source
packages/types/dist/src/logger.d.ts:20
Methods
addSerializers()
addSerializers(
serializers
):void
Parameters
Parameter | Type |
---|---|
serializers | Serializers |
Returns
void
Source
packages/types/dist/src/logger.d.ts:9
addStream()
addStream(
stream
):void
Parameters
Parameter | Type |
---|---|
stream | Stream |
Returns
void
Source
packages/types/dist/src/logger.d.ts:8
child()
child(
options
,simple
?):Logger
Parameters
Parameter | Type |
---|---|
options | Record <string , any > |
simple ? | boolean |
Returns
Source
packages/types/dist/src/logger.d.ts:10
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:53
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
Parameter | Type |
---|---|
error | Error |
...params | any [] |
Returns
void
Source
packages/types/dist/src/logger.d.ts:60
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
Parameter | Type |
---|---|
obj | Record <string , any > |
...params | any [] |
Returns
void
Source
packages/types/dist/src/logger.d.ts:68
debug(format, params)
debug(
format
, ...params
):void
Uses util.format
for msg formatting.
Parameters
Parameter | Type |
---|---|
format | any |
...params | any [] |
Returns
void
Source
packages/types/dist/src/logger.d.ts:72
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:128
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
Parameter | Type |
---|---|
error | Error |
...params | any [] |
Returns
void
Source
packages/types/dist/src/logger.d.ts:135
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
Parameter | Type |
---|---|
obj | Record <string , any > |
...params | any [] |
Returns
void
Source
packages/types/dist/src/logger.d.ts:143
error(format, params)
error(
format
, ...params
):void
Uses util.format
for msg formatting.
Parameters
Parameter | Type |
---|---|
format | any |
...params | any [] |
Returns
void
Source
packages/types/dist/src/logger.d.ts:147
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:153
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
Parameter | Type |
---|---|
error | Error |
...params | any [] |
Returns
void
Source
packages/types/dist/src/logger.d.ts:160
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
Parameter | Type |
---|---|
obj | Record <string , any > |
...params | any [] |
Returns
void
Source
packages/types/dist/src/logger.d.ts:168
fatal(format, params)
fatal(
format
, ...params
):void
Uses util.format
for msg formatting.
Parameters
Parameter | Type |
---|---|
format | any |
...params | any [] |
Returns
void
Source
packages/types/dist/src/logger.d.ts:172
flush()
flush():
Promise
<boolean
>
Terafoundation specific, flush the logs
Returns
Promise
<boolean
>
Source
packages/types/dist/src/logger.d.ts:176
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:78
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
Parameter | Type |
---|---|
error | Error |
...params | any [] |
Returns
void
Source
packages/types/dist/src/logger.d.ts:85
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
Parameter | Type |
---|---|
obj | Record <string , any > |
...params | any [] |
Returns
void
Source
packages/types/dist/src/logger.d.ts:93
info(format, params)
info(
format
, ...params
):void
Uses util.format
for msg formatting.
Parameters
Parameter | Type |
---|---|
format | any |
...params | any [] |
Returns
void
Source
packages/types/dist/src/logger.d.ts:97
level()
level()
level():
number
Returns
number
Source
packages/types/dist/src/logger.d.ts:12
level(value)
level(
value
):void
Parameters
Parameter | Type |
---|---|
value | LogLevel |
Returns
void
Source
packages/types/dist/src/logger.d.ts:13
levels()
levels()
levels():
number
[]
Returns
number
[]
Source
packages/types/dist/src/logger.d.ts:14
levels(name)
levels(
name
):number
Parameters
Parameter | Type |
---|---|
name | string | number |
Returns
number
Source
packages/types/dist/src/logger.d.ts:15
levels(name, value)
levels(
name
,value
):void
Parameters
Parameter | Type |
---|---|
name | string | number |
value | LogLevel |
Returns
void
Source
packages/types/dist/src/logger.d.ts:16
reopenFileStreams()
reopenFileStreams():
void
Returns
void
Source
packages/types/dist/src/logger.d.ts:11
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:28
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
Parameter | Type |
---|---|
error | Error |
...params | any [] |
Returns
void
Source
packages/types/dist/src/logger.d.ts:35
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
Parameter | Type |
---|---|
obj | Record <string , any > |
...params | any [] |
Returns
void
Source
packages/types/dist/src/logger.d.ts:43
trace(format, params)
trace(
format
, ...params
):void
Uses util.format
for msg formatting.
Parameters
Parameter | Type |
---|---|
format | any |
...params | any [] |
Returns
void
Source
packages/types/dist/src/logger.d.ts:47
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:103
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
Parameter | Type |
---|---|
error | Error |
...params | any [] |
Returns
void
Source
packages/types/dist/src/logger.d.ts:110
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
Parameter | Type |
---|---|
obj | Record <string , any > |
...params | any [] |
Returns
void
Source
packages/types/dist/src/logger.d.ts:118
warn(format, params)
warn(
format
, ...params
):void
Uses util.format
for msg formatting.
Parameters
Parameter | Type |
---|---|
format | any |
...params | any [] |
Returns
void
Source
packages/types/dist/src/logger.d.ts:122