onlylog
simple log
Last updated 10 months ago by taozhi8833998 .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install onlylog 
SYNC missed versions from official npm registry.

onlylog

onlylog , A pretty simple logger for Node.js

Installation

npm install onlylog

Usage

Getting start

var OnlyLog = require('onlylog')
var log = OnlyLog({
  fileName : '[test-]YYYY-MM-DD[.log]', //define log file
});
log.info('xxxx')

api

OnlyLog(options)

one of options.filename and options.stream is required

  • options

    {
      fileName : '[test-]YYYY-MM-DD[.log]', //define log file
      allLevels : ['info', 'debug', 'warn', 'error'], //define api name
      logLevels : ['info'], //define the level need to write to file
      duration : 5000, // flush buffer time, default is 2000
      bufferLength : 1000, // max buffer length, default is 0
      format: // custom format function
        function (level) {
          return function () {
            return arguments.toString()
          }
        },
      stream: process.stdout, // use stream instead of default file ouput
      rotation: 7 // 日志默认保留7天
    }
    

Current Tags

  • 1.0.0-beta3                                ...           beta (4 years ago)
  • 0.0.10                                ...           latest (10 months ago)

25 Versions

  • 0.0.10                                ...           10 months ago
  • 0.0.9                                ...           2 years ago
  • 0.0.8                                ...           2 years ago
  • 0.0.7                                ...           2 years ago
  • 0.0.6                                ...           2 years ago
  • 1.0.0-beta16                                ...           2 years ago
  • 1.0.0-beta15                                ...           2 years ago
  • 1.0.0-beta14                                ...           2 years ago
  • 1.0.0-beta13                                ...           2 years ago
  • 1.0.0-beta12                                ...           2 years ago
  • 1.0.0-beta11                                ...           2 years ago
  • 1.0.0-beta10                                ...           2 years ago
  • 1.0.0-beta9                                ...           2 years ago
  • 1.0.0-beta7                                ...           2 years ago
  • 1.0.0-beta6                                ...           2 years ago
  • 1.0.0-beta5                                ...           2 years ago
  • 1.0.0-beta4                                ...           2 years ago
  • 1.0.0-beta3                                ...           4 years ago
  • 1.0.0-beta2                                ...           4 years ago
  • 0.0.5                                ...           4 years ago
  • 1.0.0-beta1                                ...           4 years ago
  • 0.0.4                                ...           5 years ago
  • 0.0.3                                ...           5 years ago
  • 0.0.2                                ...           5 years ago
  • 0.0.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (3)
Dev Dependencies (4)

Copyright 2014 - 2016 © taobao.org |