Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 602 Bytes

README.md

File metadata and controls

25 lines (20 loc) · 602 Bytes

TargetDummy Logger

Install

$ npm i BNetTargetDummy/logger

Require

const logToConsole = require('@targetdummy/logger')('console');
const logToFile = require('@targetdummy/logger')('file');

Usage

const objectToBeLogged = { data: 'test' };

logToConsole.info(objectToBeLogged); // only outputs to console.
logToFile.info(objectToBeLogged); // outputs to console and persists to `targetdummy.log`

Result

{"request_id":"a7d37d00-e066-11e6-afcb-452332f8cf95","level":"info","message":"{\"data\":\"test\"}","timestamp":"2017-01-22T05:50:18.834Z"}