LoggerInterface
LoggerInterface doesn't exists as there is no interface support on Javascript. But as we this library aim to be interoperable with popular ones like winston we need to define what methods we rely on to let use whatever you prefer.
Methods
logger.log(level: enum(LogLevels), msg: string, context :object = null): void
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
level | enum(LogLevels) | Yes | - | The level message |
msg | string | Yes | - | The message to log |
context | ?object | No | null | A context object which should be stringify-able |
Returns:
Type: void
error
logger.error(msg: string, context :object = null): void
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
msg | string | Yes | - | The message to log |
context | ?object | No | null | A context object which should be stringify-able |
Returns:
Type: void
warn
logger.warn(msg: string, context :object = null): void
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
msg | string | Yes | - | The message to log |
context | ?object | No | null | A context object which should be stringify-able |
Returns:
Type: void
info
logger.info(msg: string, context :object = null): void
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
msg | string | Yes | - | The message to log |
context | ?object | No | null | A context object which should be stringify-able |
Returns:
Type: void
verbose
logger.verbose(msg: string, context :object = null): void
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
msg | string | Yes | - | The message to log |
context | ?object | No | null | A context object which should be stringify-able |
Returns:
Type: void
debug
logger.debug(msg: string, context :object = null): void
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
msg | string | Yes | - | The message to log |
context | ?object | No | null | A context object which should be stringify-able |
Returns:
Type: void
silly
logger.silly(msg: string, context :object = null): void
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
msg | string | Yes | - | The message to log |
context | ?object | No | null | A context object which should be stringify-able |
Returns:
Type: void