* More package.json updates & some logging early failures
This commit is contained in:
parent
1e3e0b8baa
commit
5ae0399519
|
@ -4,12 +4,33 @@
|
||||||
var bunyan = require('bunyan');
|
var bunyan = require('bunyan');
|
||||||
var miscUtil = require('./misc_util.js');
|
var miscUtil = require('./misc_util.js');
|
||||||
var paths = require('path');
|
var paths = require('path');
|
||||||
var conf = require('./config.js');
|
var fs = require('fs');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
init : function() {
|
init : function() {
|
||||||
|
var Config = require('./config.js').config;
|
||||||
//var ringBufferLimit = miscUtil.valueWithDefault(config.logRingBufferLimit, 100);
|
//var ringBufferLimit = miscUtil.valueWithDefault(config.logRingBufferLimit, 100);
|
||||||
var logPath = miscUtil.valueWithDefault(conf.config.paths.logs);
|
var logPath = Config.paths.logs;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Create something a bit more friendly if the log directory cannot be used
|
||||||
|
//
|
||||||
|
// :TODO: this seems cheesy...
|
||||||
|
var logPathError;
|
||||||
|
try {
|
||||||
|
var pathStat = fs.statSync(logPath);
|
||||||
|
if(!pathStat.isDirectory()) {
|
||||||
|
logPathError = logPath + ' is not a directory!';
|
||||||
|
}
|
||||||
|
} catch(e) {
|
||||||
|
logPathError = e.message;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(logPathError) {
|
||||||
|
console.error(logPathError);
|
||||||
|
process.exit();
|
||||||
|
}
|
||||||
|
|
||||||
var logFile = paths.join(logPath, 'enigma-bbs.log');
|
var logFile = paths.join(logPath, 'enigma-bbs.log');
|
||||||
|
|
||||||
// :TODO: make this configurable --
|
// :TODO: make this configurable --
|
||||||
|
|
|
@ -6,10 +6,12 @@
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
"async" : "0.9.x",
|
"async" : "0.9.x",
|
||||||
"binary" : "0.3.x",
|
"binary" : "0.3.x",
|
||||||
|
"buffers" : "0.1.x",
|
||||||
"bunyan" : "1.3.x",
|
"bunyan" : "1.3.x",
|
||||||
"iconv-lite" : "0.4.x",
|
"iconv-lite" : "0.4.x",
|
||||||
"lodash" : "3.7.x",
|
"lodash" : "3.7.x",
|
||||||
"sqlite3" : "3.0.x",
|
"sqlite3" : "3.0.x",
|
||||||
|
"ssh2" : "0.4.x",
|
||||||
"strip-json-comments" : "1.0.x"
|
"strip-json-comments" : "1.0.x"
|
||||||
},
|
},
|
||||||
"engine" : "node >= 0.12.2"
|
"engine" : "node >= 0.12.2"
|
||||||
|
|
Loading…
Reference in New Issue