tiny-log
v1.2.0
Published
a tiny logger
Downloads
9
Readme
tiny-log
a tiny logger for node.js, base on logfilestream
example
const tinyLog = require('tiny-log');
const logger = tinyLog({
std: true,
name: 'example',
dir: __dirname,
duration: 60000,
levels: ['log', 'info', 'error']
});
logger.log('example');
logger.info('hello world');
logger.error(new Error('example'));
options
- dir - log file dir
- name - log file name prefix, default
''
- std - output to std ? default
false
- file - output to file ? default
true
- trace - trace stack, default
false
- boundary - log boundary, default
os.EOL
- levels - log levels, default
['info', 'error']
- duration - log file duration, default
86400000
, one day
License
MIT