0.0.1 • Published 7 years ago

logxx v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

logxx

Build Status Coverage Status Deps npm npm GitHub license

A simple logger that just work.

Features:

  • no dependency.
  • configurable log levels.
  • configurable appender. such as stdout, file and all writable streams.

Installation

$ npm install logxx -S

Usage

var logxx = require('logxx');

logxx.info('Something');

By default, logxx will output logs to stdout.

Document

  • logxx

    It is a predefined 'standard' Logger accessible through helper functions, which are easier to use than creating a Logger manually.

    propertydefault value
    log levellogxx.L_INFO
    outputprocess.stdout
  • log level

    log leveldescription
    logxx.L_SILENCEoutput nothing
    logxx.L_ERRORoutput error only
    logxx.L_INFOoutput both error and info
  • creates a new logger

    Function: logxx.newLogger(level, output)

    The level variable sets the log level. value: logxx.L_SILENCE, logxx.L_ERROR, logxx.L_INFO default: logxx.L_INFO

    The output variable sets the destination to which log data will be written. type: streams.Writable, default: process.stdout.

  • more functions

    functionsdescription
    logxx.info(anything)output normal message
    logxx.error(anything)output error message
    logxx.getLevel()return log level
    logxx.setLevel(level)set log level
    logxx.getOutput()return output appender
    logxx.setOutput(level)set output appender

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

this repo is released under the MIT License.