bare-system-logger
System logger for Bare
Documented against
v1.0.5stable
bare-system-logger — System logger for Bare. It is a native addon.
npm i bare-system-loggerUsage
const SystemLog = require('bare-system-logger')
const log = new SystemLog()
log.info('Hello %s', 'world!')API
SystemLog
clear(): void
colors: boolean
debug(...data: unknown[]): void
Log data at the debug level, formatted printf-style via bare-format.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
data | unknown[] | — | Values to log; if the first is a string containing %s/%d/%i/%f/%j/%o/%O/%c placeholders, the rest substitute into it. |
error(...data: unknown[]): void
Log data at the error level, formatted printf-style via bare-format.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
data | unknown[] | — | Values to log; if the first is a string containing %s/%d/%i/%f/%j/%o/%O/%c placeholders, the rest substitute into it. |
fatal(...data: unknown[]): void
Log data at the fatal level, formatted printf-style via bare-format.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
data | unknown[] | — | Values to log; if the first is a string containing %s/%d/%i/%f/%j/%o/%O/%c placeholders, the rest substitute into it. |
format(...data: unknown[]): string
Format data printf-style via bare-format, without logging it.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
data | unknown[] | — | Values to format; if the first is a string containing %s/%d/%i/%f/%j/%o/%O/%c placeholders, the rest substitute into it. |
info(...data: unknown[]): void
Log data at the info level, formatted printf-style via bare-format.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
data | unknown[] | — | Values to log; if the first is a string containing %s/%d/%i/%f/%j/%o/%O/%c placeholders, the rest substitute into it. |
warn(...data: unknown[]): void
Log data at the warn level, formatted printf-style via bare-format.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
data | unknown[] | — | Values to log; if the first is a string containing %s/%d/%i/%f/%j/%o/%O/%c placeholders, the rest substitute into it. |
See also
- Builds on
bare-logger. - Bare modules — the full
bare-*catalog. - Bare runtime API — the runtime these modules extend.