1.3.1 • Published 6 years ago
tlf-log v1.3.1
tlf-log
A simple module for easy logging
Installation
npm i -S tlf-log
Typical Usage
const log = require("tlf-log");
log.trace("Starting up!");
Documentation
Function | Description |
---|---|
log.<level>(msgs) | Logs the given messages at the specified level. |
log.<level>_(msgs) | Logs the given messages at the specified level without printing a newline. |
log._setLevel(<lvl>) | Sets the minimum level to log -- all lower levels will be ignored. Can also be set to 'silent' to silence all but fatal messages. |
log._addLevel(<name>, <opts>) | Adds a new log level. Valid options are "before", "after" and "afterLog". |
log._indent() | Indents the next messages by 2 spaces. |
log._deindent() | Deindents the next messages by 2 spaces. |
log._prefix(<name>) | Adds a prefix to the next messages. |
log._deprefix(<name>) | Removes the most recent prefix. |