Logger

5.1.0

object

methodsubLogger
(name: string) => API

Description

Creates a new logger which is a sub-logger of the current one.

Parameters

Name
Type
Required
Description

name

string

yes

Name for the sub-logger.

Returns

API

(level: LogLevel) => LogLevel

Description

Sets or gets the current threshold level for publishing to a file.

Parameters

Name
Type
Required
Description

level

no

Logger level.

Returns

LogLevel

(level: LogLevel) => LogLevel

Description

Sets or gets the current threshold level for writing to the console.

Parameters

Name
Type
Required
Description

level

no

Logger level.

Returns

LogLevel

methodlog
(message: string, level: LogLevel) => void

Description

Logging method.

Parameters

Name
Type
Required
Description

message

string

yes

Message to log.

level

no

Logging level for the message.

Returns

void

methodtrace
(message: string) => void

Description

Method for logging messages at “trace” level.

Parameters

Name
Type
Required
Description

message

string

yes

Message to log.

Returns

void

methoddebug
(message: string) => void

Description

Method for logging messages at “debug” level.

Parameters

Name
Type
Required
Description

message

string

yes

Message to log.

Returns

void

methodinfo
(message: string) => void

Description

Method for logging messages at “info” level.

Parameters

Name
Type
Required
Description

message

string

yes

Message to log.

Returns

void

methodwarn
(message: string) => void

Description

Method for logging messages at “warn” level.

Parameters

Name
Type
Required
Description

message

string

yes

Message to log.

Returns

void

methoderror
(message: string, err: Error) => void

Description

Method for logging messages at “error” level.

Parameters

Name
Type
Required
Description

message

string

yes

Message to log.

err

Error

no

Returns

void

methodcanPublish
(level: LogLevel) => boolean

Description

Checks if the logger can publish a log level

Parameters

Name
Type
Required
Description

level

yes

Returns

boolean

Properties

string

Name of the logger.

string

Version of the Logging API.