@terascope/types / logger / Logger
Class: Logger
Extends
EventEmitter
Constructors
new Logger()
new Logger(
options
):Logger
Parameters
Parameter | Type |
---|---|
options | LoggerOptions |
Returns
Overrides
EventEmitter.constructor
Source
Properties
fields
fields:
any
Source
src
src:
boolean
Source
streams
streams:
internal
|WritableStream
<any
> |undefined
[]
Terafoundation specific
Source
Methods
addSerializers()
addSerializers(
serializers
):void
Parameters
Parameter | Type |
---|---|
serializers | Serializers |
Returns
void
Source
addStream()
addStream(
stream
):void
Parameters
Parameter | Type |
---|---|
stream | Stream |
Returns
void
Source
child()
child(
options
,simple
?):Logger
Parameters
Parameter | Type |
---|---|
options | Record <string , any > |
simple ? | boolean |
Returns
Source
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
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
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
debug(format, params)
debug(
format
, ...params
):void
Uses util.format
for msg formatting.
Parameters
Parameter | Type |
---|---|
format | any |
...params | any [] |
Returns
void
Source
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
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
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
error(format, params)
error(
format
, ...params
):void
Uses util.format
for msg formatting.
Parameters
Parameter | Type |
---|---|
format | any |
...params | any [] |
Returns
void
Source
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
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
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
fatal(format, params)
fatal(
format
, ...params
):void
Uses util.format
for msg formatting.
Parameters
Parameter | Type |
---|---|
format | any |
...params | any [] |
Returns
void
Source
flush()
flush():
Promise
<boolean
>
Terafoundation specific, flush the logs
Returns
Promise
<boolean
>
Source
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
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
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
info(format, params)
info(
format
, ...params
):void
Uses util.format
for msg formatting.
Parameters
Parameter | Type |
---|---|
format | any |
...params | any [] |
Returns
void
Source
level()
level()
level():
number
Returns
number
Source
level(value)
level(
value
):void
Parameters
Parameter | Type |
---|---|
value | LogLevel |
Returns
void
Source
levels()
levels()
levels():
number
[]
Returns
number
[]
Source
levels(name)
levels(
name
):number
Parameters
Parameter | Type |
---|---|
name | string | number |
Returns
number
Source
levels(name, value)
levels(
name
,value
):void
Parameters
Parameter | Type |
---|---|
name | string | number |
value | LogLevel |
Returns
void
Source
reopenFileStreams()
reopenFileStreams():
void
Returns
void
Source
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
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
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
trace(format, params)
trace(
format
, ...params
):void
Uses util.format
for msg formatting.
Parameters
Parameter | Type |
---|---|
format | any |
...params | any [] |
Returns
void
Source
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
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
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
warn(format, params)
warn(
format
, ...params
):void
Uses util.format
for msg formatting.
Parameters
Parameter | Type |
---|---|
format | any |
...params | any [] |
Returns
void