-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed negative cases and running behavior for hooks.
- Loading branch information
1 parent
1f8d2e4
commit 2b047bc
Showing
7 changed files
with
433 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,29 @@ | ||
const log4js = require('log4js'); | ||
const logLevel = process.env.LOG_LEVEL || 'info'; | ||
|
||
function getLogger(loggerName) { | ||
const logger = log4js.getLogger(loggerName); | ||
// Set default log level to info | ||
logger.level = process.env.LOG_LEVEL || "info"; | ||
return logger; | ||
log4js.configure({ | ||
appenders: { | ||
out: { | ||
type: 'stdout', | ||
layout: { | ||
type: 'pattern', | ||
pattern: '%[%d{dd-MM-yy hh:mm:ss} | %p | %f{1}:%l%] - %m', | ||
} | ||
} | ||
}, | ||
categories: { | ||
default: { | ||
appenders: ['out'], | ||
useCallStack: true, | ||
enableCallStack: true, | ||
level: logLevel | ||
} | ||
} | ||
}); | ||
|
||
|
||
function getLogger() { | ||
return log4js.getLogger(); | ||
} | ||
|
||
module.exports = getLogger; |
Oops, something went wrong.