0.0.1 • Published 8 years ago

PDD-log4js-es5 v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 years ago

#es5版log4js 比较简单,功能比较单一,编码默认为utf8,且唯一

###*usage

var log4js = require('PDD-log4js-es5')
var initLogger = log4js.initLogger
var getLogger = log4js.getLogger


//初始化
var config = [
  {
    cheese:'tttt',
    format:'MM-DD-YYYY HH:mm:ss',
    file:'./xxxx/datalog.log',
    level: 'INFO',
    backups:10,
    limitSize:5
  },
  {
    cheese:'cheese',
    format:'MM-DD-YYYY HH:mm:ss',   //format date
    file:'./log/datalog.log',   //file to you path
    level: 'INFO',   //level
    backups:3,   //backup   3 days
    limitSize:1   //size  mb
  }
]

// or config like this
var config = {
  console:{
    type: 'console',
    forbidden: true   //cancel  console pretty
  }
}

initlogger(config)
var logger = getLogger(cheese)   //getLogger('cheese')
logger.info('hello world')
//[ 06-15-2016 23:28:44 ] [ INFO ] [ yyyyyyyy ] -- hello world 

###*技能点

###*参考的一些文文章记录等

###*联系方式

0.0.1

8 years ago