ptz-log
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

ptz-log

Build Status NPM codecov.io Dependency Status bitHound Score MIT license

Awesome log and types for javascript and typescript!

Translations

pt-br en-us

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

Readme

Keywords

none

Package Sidebar

Install

npm i ptz-log

Weekly Downloads

49

Version

1.2.1

License

ISC

Last publish

Collaborators

  • alanmarcell
  • angeloocana