logxx
v0.0.1
Published
A simple logger that just work.
Readme
logxx
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 -SUsage
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.
| property | default value | |:----------|:-----------------| | log level |
logxx.L_INFO| | output |process.stdout|log level
| log level | description | |:------------------|:-------------------------------| |
logxx.L_SILENCE| output nothing | |logxx.L_ERROR| outputerroronly | |logxx.L_INFO| output botherrorandinfo|creates a new logger
Function:
logxx.newLogger(level, output)The
levelvariable sets the log level. value:logxx.L_SILENCE,logxx.L_ERROR,logxx.L_INFOdefault:logxx.L_INFOThe
outputvariable sets the destination to which log data will be written. type:streams.Writable, default:process.stdout.more functions
| functions | description | |:-------------------------|:-----------------------| |
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
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
License
this repo is released under the MIT License.

