Types: `Logger Logger 1`
logger.Logger
Hierarchy
EventEmitter
↳
Logger
Table of contents
Constructors
Properties
Methods
- addSerializers
- addStream
- child
- debug
- error
- fatal
- flush
- info
- level
- levels
- reopenFileStreams
- trace
- warn
Constructors
constructor
• new Logger(options
): Logger
Parameters
Name | Type |
---|---|
options | LoggerOptions |
Returns
Overrides
EventEmitter.constructor
Defined in
Properties
fields
• fields: any
Defined in
src
• src: boolean
Defined in
streams
• streams: internal
| WritableStream
<any
> | undefined
[]
Terafoundation specific
Defined in
Methods
addSerializers
▸ addSerializers(serializers
): void
Parameters
Name | Type |
---|---|
serializers | Serializers |
Returns
void
Defined in
addStream
▸ addStream(stream
): void
Parameters
Name | Type |
---|---|
stream | Stream |
Returns
void
Defined in
child
▸ child(options
, simple?
): Logger
Parameters
Name | Type |
---|---|
options | Record <string , any > |
simple? | boolean |
Returns
Defined in
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
Defined in
▸ 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
Name | Type |
---|---|
error | Error |
...params | any [] |
Returns
void
Defined in
▸ 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
Name | Type |
---|---|
obj | Record <string , any > |
...params | any [] |
Returns
void
Defined in
▸ debug(format
, ...params
): void
Uses util.format
for msg formatting.
Parameters
Name | Type |
---|---|
format | any |
...params | any [] |
Returns
void
Defined in
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
Defined in
▸ 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
Name | Type |
---|---|
error | Error |
...params | any [] |
Returns
void
Defined in
▸ 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
Name | Type |
---|---|
obj | Record <string , any > |
...params | any [] |
Returns
void
Defined in
▸ error(format
, ...params
): void
Uses util.format
for msg formatting.
Parameters
Name | Type |
---|---|
format | any |
...params | any [] |
Returns
void
Defined in
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
Defined in
▸ 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
Name | Type |
---|---|
error | Error |
...params | any [] |
Returns
void
Defined in
▸ 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
Name | Type |
---|---|
obj | Record <string , any > |
...params | any [] |
Returns
void
Defined in
▸ fatal(format
, ...params
): void
Uses util.format
for msg formatting.
Parameters
Name | Type |
---|---|
format | any |
...params | any [] |
Returns
void
Defined in
flush
▸ flush(): Promise
<boolean
>
Terafoundation specific, flush the logs
Returns
Promise
<boolean
>
Defined in
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
Defined in
▸ 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
Name | Type |
---|---|
error | Error |
...params | any [] |
Returns
void
Defined in
▸ 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
Name | Type |
---|---|
obj | Record <string , any > |
...params | any [] |
Returns
void
Defined in
▸ info(format
, ...params
): void
Uses util.format
for msg formatting.
Parameters
Name | Type |
---|---|
format | any |
...params | any [] |
Returns
void
Defined in
level
▸ level(): number
Returns
number
Defined in
▸ level(value
): void
Parameters
Name | Type |
---|---|
value | LogLevel |
Returns
void
Defined in
levels
▸ levels(): number
[]
Returns
number
[]
Defined in
▸ levels(name
): number
Parameters
Name | Type | |
---|---|---|
name | string \ | number |
Returns
number
Defined in
▸ levels(name
, value
): void
Parameters
Name | Type | |
---|---|---|
name | string \ | number |
value | LogLevel |
Returns
void
Defined in
reopenFileStreams
▸ reopenFileStreams(): void
Returns
void
Defined in
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
Defined in
▸ 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
Name | Type |
---|---|
error | Error |
...params | any [] |
Returns
void
Defined in
▸ 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
Name | Type |
---|---|
obj | Record <string , any > |
...params | any [] |
Returns
void
Defined in
▸ trace(format
, ...params
): void
Uses util.format
for msg formatting.
Parameters
Name | Type |
---|---|
format | any |
...params | any [] |
Returns
void
Defined in
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
Defined in
▸ 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
Name | Type |
---|---|
error | Error |
...params | any [] |
Returns
void
Defined in
▸ 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
Name | Type |
---|---|
obj | Record <string , any > |
...params | any [] |
Returns
void
Defined in
▸ warn(format
, ...params
): void
Uses util.format
for msg formatting.
Parameters
Name | Type |
---|---|
format | any |
...params | any [] |
Returns
void