clog 0,0

Colorful console output in NodeJS.

2 years after

clog

Colorful console output for your applications in NodeJS.

  • Colors for log, info, warn and error
  • Support custom labels
  • Support display level and custom display level
  • Tiny library
  • Easy to use

Installing

GIT

$ git clone https://github.com/firejune/clog.git

NPM

$ npm install clog

Usage

    var clog = require('clog');

    clog('server', 'start listening on port 3000');  // custom head

    clog.log('hello', 'world');                      // console.log
    clog.info(['foo', 'bar']);                       // console.info
    clog.warn('baz is deprecated.');                 // console.warn
    clog.error('HTTP/1.1 400 Bad Request');          // console.error
    clog.debug('headers', {                          // console.debug
        'Content-Type': 'text/javascript'
    });

Configure

    // display level configration:
    clog.configure({'log level': 2});
    //=> {'log': true, 'info': true, 'warn': false, 'error': false, 'debug': false}

    // custom display configration:
    clog.configure({
        'log level': {
            'log': true,
            'info': true,
            'warn': false,
            'error': true,
            'debug': false
        }
    });
    //=> {'log': true, 'info': true, 'warn': false, 'error': true, 'debug': false}

Output

output

Have fun!

License

MIT <3

Related Repositories

clog-cli

clog-cli

Generate beautiful changelogs from your Git commit history ...

CLog.js

CLog.js

Small Javascript library to color and organize your console.log in Google Chrome ...

Python-CLog

Python-CLog

A simple log module which can print the caller function and caller function's ca ...

clog-cli

clog-cli

An npm distribution of the amazing clog tool ...


Top Contributors

firejune bennidhamma