symbol-log
v0.1.1
Published
Output messages with colored markers
Downloads
47
Maintainers
Readme
symbol-log
Output messages with colored markers.
API
logger = require('symbol-log')
Get default logger
.
logger.options
Options set for logger
.
newLogger = logger(options)
Make new logger
with modified options.
newLogger = logger.indent(level)
Make new logger
with increased indentation level.
newLogger = logger.unindent(level)
Make new logger
with decreased indentation level. Same as logger.indent(-level)
.
logger(marker, message, [options])
Use logger
to write the marked message.
Returns logger
.
logger.puts([message]...)
Write each unmarked message in turn. Equivalent to logger('', message, { template: '${message}' })
(for a single argument).
Returns logger
.
logger.<marker-name>(message, [options])
Write message with one of built-in markers.
Returns logger
.
Options
| Option | Type | Required? | Default |
| :------- | :------------- | :-------: | :------------------------ |
| output | WritableStream | No | process.stderr
|
| template | string | No | " ${marker} ${message}"
|
Templating syntax is LoDash's.
Markers
Four semantic markers are provided by log-symbols package, which also defines some fallbacks for Windows.
| Name | Marker | | :------ | :---------------: | | info | ℹ (blue) | | success | ✔ (green) | | warning | ⚠ (yellow) | | error | ✖ (red) | | black | * | | red | * | | green | * | | yellow | * | | blue | * | | magenta | * | | cyan | * | | white | * | | gray | * |
Install
npm install symbol-log
License
MIT