1.0.5 • Published 4 years ago
node-tag-log v1.0.5
A very minimalistic logging helper.
See src/libs/index.js for the implementation. It's only a few lines of code so far.
Setup
npm install https://github.com/C5H8NNaO4/node-tag-log
Quick Start
import {log, called, assigned, debug, caught} from '.';
import * as LEVELS from './levels'
process.env.LOG_LEVEL = LEVELS.debug
log`Hello World`
debug`Will only be shown when the log level is set to debug`
function initStateMachine (definition) {
called`initStateMachine (definition = ${definition})`;
let machine;
try {
machine = new Machine (definition);
assigned`machine = ${machine} = new Machine (stateMachine);`
} catch (e) {
caught`Error ${e}[0-4]`
}
return machine;
}
function Machine (definition) {
this.id = 'hello-world'
}
initStateMachine ({})
Build
npm run build
Runs babel src --out-dir lib
Test
npm run test
Runs jest