mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 14:44:40 +02:00
+ Initial source checkin
This commit is contained in:
parent
9804c93f2e
commit
9a7e90b9b2
31 changed files with 4361 additions and 0 deletions
39
core/logger.js
Normal file
39
core/logger.js
Normal file
|
@ -0,0 +1,39 @@
|
|||
"use strict";
|
||||
|
||||
var bunyan = require('bunyan');
|
||||
var miscUtil = require('./misc_util.js');
|
||||
var paths = require('path');
|
||||
var conf = require('./config.js');
|
||||
|
||||
module.exports = {
|
||||
log : undefined,
|
||||
|
||||
init : function() {
|
||||
//var ringBufferLimit = miscUtil.valueWithDefault(config.logRingBufferLimit, 100);
|
||||
var logPath = miscUtil.valueWithDefault(conf.config.paths.logs);
|
||||
var logFile = paths.join(logPath, 'enigma-bbs.log');
|
||||
|
||||
// :TODO: make this configurable --
|
||||
// user should be able to configure rotations, levels to file vs ringBuffer,
|
||||
// completely disable logging, etc.
|
||||
|
||||
this.log = bunyan.createLogger({
|
||||
name : 'ENiGMA½ BBS',
|
||||
streams : [
|
||||
{
|
||||
type : 'rotating-file',
|
||||
path : logFile,
|
||||
period : '1d',
|
||||
count : 3,
|
||||
level : 'trace'
|
||||
}
|
||||
/*,
|
||||
{
|
||||
type : 'raw',
|
||||
stream : ringBuffer,
|
||||
level : 'trace'
|
||||
}*/
|
||||
]
|
||||
});
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue