Class: KipperLogger
logger.KipperLogger
The KipperLogger class, which implements the specific logging logic for this library.
Since
0.0.3
Table of contents
Constructors
Properties
Accessors
Methods
Constructors
constructor
• new KipperLogger(emitHandler
, logLevel?
, reportWarnings?
)
Parameters
Name | Type | Default value |
---|---|---|
emitHandler |
(level : LogLevel , msg : string ) => void |
undefined |
logLevel |
LogLevel |
LogLevel.INFO |
reportWarnings |
boolean |
true |
Defined in
kipper/core/src/logger.ts:89
Properties
_emitHandler
• Private
Readonly
_emitHandler: (level
: LogLevel
, msg
: string
) => void
Type declaration
▸ (level
, msg
): void
The private field '_emitHandler' that actually stores the variable data, which is returned inside the this.emitHandler.
Parameters
Name | Type |
---|---|
level |
LogLevel |
msg |
string |
Returns
void
Defined in
kipper/core/src/logger.ts:61
logLevel
• logLevel: LogLevel
The current log level of the KipperLogger. Everything with a lower level will be ignored and not logged.
Defined in
kipper/core/src/logger.ts:80
reportWarnings
• Readonly
reportWarnings: boolean
If set to true, warnings will be reported. Otherwise, they will be ignored even if the log level is set to 'WARN' or lower.
Since
0.9.0
Defined in
kipper/core/src/logger.ts:87
levels
▪ Static
levels: typeof LogLevel
= LogLevel
Available log levels for the KipperLogger.
Static
Defined in
kipper/core/src/logger.ts:68
numLevels
▪ Static
numLevels: typeof LogLevel
= LogLevel
Available log levels in numeric form for the KipperLogger.
Static
Defined in
kipper/core/src/logger.ts:75
Accessors
emitHandler
• get
emitHandler(): (level
: LogLevel
, msg
: string
) => void
The specific handler that should handle emitted log messages
Returns
fn
▸ (level
, msg
): void
The specific handler that should handle emitted log messages
Parameters
Name | Type |
---|---|
level |
LogLevel |
msg |
string |
Returns
void
Defined in
kipper/core/src/logger.ts:102
Methods
debug
▸ debug(msg
): void
Logs a message with the severity 'debug'
Parameters
Name | Type | Description |
---|---|---|
msg |
string |
The message to log |
Returns
void
Defined in
kipper/core/src/logger.ts:110
error
▸ error(msg
): void
Logs a message with the severity 'error'
Parameters
Name | Type | Description |
---|---|---|
msg |
string |
The message to log |
Returns
void
Defined in
kipper/core/src/logger.ts:134
fatal
▸ fatal(msg
): void
Logs a message with the severity 'fatal'
Parameters
Name | Type | Description |
---|---|---|
msg |
string |
The message to log |
Returns
void
Defined in
kipper/core/src/logger.ts:142
info
▸ info(msg
): void
Logs a message with the severity 'info'
Parameters
Name | Type | Description |
---|---|---|
msg |
string |
The message to log |
Returns
void
Defined in
kipper/core/src/logger.ts:118
log
▸ log(level
, msg
): void
Logs a general message, and invokes the proper emit handler for it.
Parameters
Name | Type | Description |
---|---|---|
level |
LogLevel |
The level of the logging message. |
msg |
string |
The content of the logging message. |
Returns
void
Defined in
kipper/core/src/logger.ts:151
reportError
▸ reportError(level
, err
): void
Reports an error with the passed level.
Since
0.4.0
Parameters
Name | Type | Description |
---|---|---|
level |
ERROR | FATAL |
The level to log the error with. |
err |
string | KipperError |
The error to log. |
Returns
void
Defined in
kipper/core/src/logger.ts:167
reportWarning
▸ reportWarning(warn
): void
Reports a warning with the passed level.
Since
0.9.0
Parameters
Name | Type | Description |
---|---|---|
warn |
string | KipperWarning |
The warning to log. |
Returns
void
Defined in
kipper/core/src/logger.ts:176
warn
▸ warn(msg
): void
Logs a message with the severity 'warn'
Parameters
Name | Type | Description |
---|---|---|
msg |
string |
The message to log |
Returns
void
Defined in
kipper/core/src/logger.ts:126