-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feature/tobt-update-warning
- Loading branch information
Showing
60 changed files
with
2,353 additions
and
2,001 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import winston from 'winston'; | ||
|
||
import getConfig from './config'; | ||
|
||
const { logging } = getConfig(); | ||
|
||
const transports = [ | ||
new winston.transports.File({ | ||
filename: 'app.log', | ||
level: logging.levelFile, | ||
}), | ||
new winston.transports.Console({ | ||
level: logging.levelConsole, | ||
format: winston.format.colorize({ all: true }), | ||
}), | ||
]; | ||
|
||
const logger = winston.createLogger({ | ||
exitOnError: false, | ||
format: winston.format.combine( | ||
winston.format.timestamp({ format: 'YYYY-MM-DD HH:mm:ss' }), | ||
winston.format.splat(), | ||
winston.format.printf(info => `${info.timestamp} ${info.level}: ${info.message}`), | ||
), | ||
transports, | ||
}); | ||
|
||
winston.addColors({ | ||
error: 'brightRed', | ||
warn: 'yellow', | ||
info: 'green', | ||
http: 'magenta', | ||
verbose: 'brightBlue', | ||
debug: 'brightCyan', | ||
silly: 'gray', | ||
}); | ||
|
||
process.on('warning', e => logger.warn('%o', e)); | ||
process.on('uncaughtException', e => logger.error('%o', e)); | ||
process.on('unhandledRejection', e => logger.error('%o', e)); | ||
|
||
export default logger; |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.