Skip to content

Commit

Permalink
Update example/common/utils_log.js to support log4js 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
akihikodaki committed Aug 1, 2017
1 parent 74df983 commit 268619a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions example/common/utils_log.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,25 @@ var log4js = require('log4js')
// var path = require('path')

function getLogger (category, level) {
var log
if (level == null) {
level = 'INFO'
}

log4js.configure({
appenders: [
{
appenders: {
console: {
type: 'console'
}
]
},
categories: {
default: {
appenders: ['console'],
level
}
}
})

log = log4js.getLogger(category)
log.setLevel(level)
return log
return log4js.getLogger(category)
}

function Log (filename, level) {
Expand Down

0 comments on commit 268619a

Please sign in to comment.