ptz-log
Awesome log and types for javascript and typescript!
Translations
Use
Install
npm install --save ptz-log
How to use
import log from 'ptz-log'; log('hi'); // Colors are optional log({ ptzColorLog: 'red' }, 'welcome', { ptzColorLog: 'yellow' }, 'to', { ptzColorLog: 'green' }, 'polutz!');
How to use Ilog type as dependency injection, and provide your custom logs
import { Ilog, log } from 'ptz-log'; const myLog: Ilog = function (...args) { console.log('From my custom logging:', ...args); } class Test { log: Ilog; constructor({ log: Ilog }) { this.log = log; } testing() { log('returning true!'); return true; } } const test = new Test({ log: myLog }); test.testing();
Contribute
NPM Global packages
npm install -g ts-node babel-cli
Setup
npm install
Test
npm test