GitXplorerGitXplorer
l

stream-log-level

public
4 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
81676570c1c051368d6b89a114aaeebcff7ffd9b

[ci] Update coverallsapp/github-action action to v2

llpinca committed 2 years ago
Unverified
3bd4f9a846bf7db0f0e2c0463f435f0d65829137

[doc] Fix CI badge URL

llpinca committed 2 years ago
Unverified
652c7f0fa95d1d52368fd63ebd5d49f1c31998db

[ci] Test on node 18

llpinca committed 2 years ago
Unverified
f7041c9ea8aed6bd52567ab74f1ed1cf4c65381d

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

llpinca committed 2 years ago
Unverified
8b2ff65204b2525b396a4c6c9d9f12994ecafd57

[ci] Update actions/checkout action to v3

llpinca committed 2 years ago
Unverified
9089848f33126098d6c31258258bbb5e53655fad

[ci] Test on node 16

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