Bare Docs
ReferenceBareModules

bare-system-logger

System logger for Bare

Documented against v1.0.5
stable

bare-system-logger — System logger for Bare. It is a native addon.

npm i bare-system-logger

Usage

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

ParameterTypeDefaultDescription
dataunknown[]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

ParameterTypeDefaultDescription
dataunknown[]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

ParameterTypeDefaultDescription
dataunknown[]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

ParameterTypeDefaultDescription
dataunknown[]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

ParameterTypeDefaultDescription
dataunknown[]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

ParameterTypeDefaultDescription
dataunknown[]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

On this page