Git Product home page Git Product logo

catlog's Introduction

catlog

Build Status Coverage Status

NPM

Modern log utility for node apps

  • debug utility like visionmedia/debug
  • full feature logging utilites
  • extensible logging frameworks
    • plugins like formatters and log handlers
    • event-driven logging activity
    • context-based configuration

Documentation

See more at http://robinqu.github.io/catlog.

TL;DR

Simple debug

Just like the popular visionmedia/debug.

const debug = require('catlog')('app:main');

debug('I am here');
debug('Hi, babe!');

But the log goes to other handlers (fs_handler as default) as well. So your debug info will have chances to be recorded by fs_handler in files, instead of being deserted if no DEBUG env is set.

Log, in levels

Behave like old-fashined log utilites.

const logger = require('catlog')();

logger.info('good news');
logger.warn('important notice');
logger.error('bad news');
logger.debug('verbose news');
//also have alias, as `log`
logger.log('bad news');

Configuration

All settings are shared in the same process. And configure it on logging context, using:

const logger = require('catlog')({
  methods: {
    foobar: {
      target: 'stdout',
      level: 70
    }
  },
  category: 'special_app'
});

License

MIT

catlog's People

Contributors

robinqu avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

catlog's Issues

TC and CI

  • travis-ci
  • plugins
    • simple_formatter
    • fitlered_formatter
    • redis_handler
    • fs_handler
  • context
  • log_method
  • raw

coloring

  • only colouring output in stdout, stderr
  • clean output

compatible with visionmedia/debug

  • if debug level is not enabled in stdout, DEBUG env variable can make a selection of subject
  • if debug level is enabled in stdout, all debug logs are output, regardless of DEBUG env.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.