GitXplorerGitXplorer
l

stream-log-level

public
4 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
b39971d9af7cca615d946b33707d187ddaad78b2

[ci] Update actions/setup-node action to v2

llpinca committed 4 years ago
Unverified
fda388b7ec1646686006d01c21658e3b339b185c

[ci] Use GitHub Actions

llpinca committed 4 years ago
Unverified
4b2b3feedd20c564157569cd3a206f9db5d88e10

[pkg] Replace nyc with c8

llpinca committed 4 years ago
Unverified
b7754326755dd48d0d59eda636291f53b6e57e8e

[pkg] Update dev dependencies

llpinca committed 4 years ago
Unverified
6f5ec17e36d8540f658394e8e87ce7dc620f9f50

[test] Test on node 14

llpinca committed 4 years ago
Unverified
4239e5553f448061772184c88d5eda616fc7061f

[ci] Remove node 8 from the test matrix

llpinca committed 4 years ago

README

The README file for this repository.

stream-log-level

Version npm Build Status Coverage Status

Simple and lightweight logger that writes to a stream.

This module is like console-log-level but instead of using the console object it uses a given stream.

Log levels supported: trace, debug, info, warn, error and fatal.

Install

npm install --save stream-log-level

Usage

var logger = require('stream-log-level');

var log = logger();

log.trace('a'); // => does nothing
log.debug('b'); // => does nothing
log.info('c'); // => writes 'c\n' to STDOUT
log.warn('d'); // => writes 'd\n' to STDOUT
log.error('e'); // => writes 'e\n' to STDOUT
log.fatal('f'); // => writes 'f\n' to STDOUT

Options

The logger can be configured by passing in an options object:

var logger = require('stream-log-level');

var log = logger({
  prefix: function () {
    return new Date().toISOString();
  },
  level: 'info'
});

Supported options:

Name Description Type Default value
level Specify the log level String info
prefix Set a prefix for all log messages String or Function undefined
stream The stream to write to Stream process.stdout

License

MIT