lyg
v0.0.8
Published
nodejs console log util
Downloads
2
Maintainers
Readme
Table of Contents generated with DocToc
lyg.js
- lyg.js is a useful console logger tool;
- show time, level, shortFileName, lineNumber, functionName, Message
usage
'use strict';
const l = require('lyg');
const err = new Error('i am error')
const obj = {
name: 'YT',
test: true,
num: 10,
date: new Date()
};
l.l('coming anonymous');
l.i('multi value - %s:%d ', 'info', 100);
l.w('waring: %d', 10);
l.e('%s', err.message);
l.d(obj);
l.d('Hello, %s | %s \n', 'YT', 'string');
function getInfo() {
l.i('coming getInfo');
l.l('multi: %s | %s', 'getInfo', true);
l.w('waring: %d', 10);
l.e('%s', err.message);
l.d(obj);
l.d('Hello, %s | %s \n', 'YT', 100);
}
getInfo();
l.t('the trace info');
API
$ l.i = console.info
$ l.l = console.log
$ l.e = console.error
$ l.w = console.warn
$ l.d = console.dir
$ l.t = console.trace
format
$ [time]-[level]-[fileName]-[lineNumber]-[functionName]-msg: [Message]