Loading config.js +9 −1 Original line number Diff line number Diff line Loading @@ -3,6 +3,14 @@ "host": "localhost", "port": 7777, "keyLength": 6 "keyLength": 6, "logging": [ { "level": "verbose", "type": "Console", "colorize": true } ] } server.js +13 −3 Original line number Diff line number Diff line Loading @@ -12,9 +12,19 @@ var config = JSON.parse(fs.readFileSync('config.js', 'utf8')); config.port = config.port || 7777; config.host = config.host || 'localhost'; // Configure logging - TODO make configurable // Set up the logger if (config.logging) { try { winston.remove(winston.transports.Console); winston.add(winston.transports.Console, { colorize: true, level: 'verbose' }); } catch(er) { } var detail, type; for (var i = 0; i < config.logging.length; i++) { detail = config.logging[i]; type = detail.type; delete detail.type; winston.add(winston.transports[type], detail); } } // TODO preparse static instead of using exists // TODO implement command line Loading Loading
config.js +9 −1 Original line number Diff line number Diff line Loading @@ -3,6 +3,14 @@ "host": "localhost", "port": 7777, "keyLength": 6 "keyLength": 6, "logging": [ { "level": "verbose", "type": "Console", "colorize": true } ] }
server.js +13 −3 Original line number Diff line number Diff line Loading @@ -12,9 +12,19 @@ var config = JSON.parse(fs.readFileSync('config.js', 'utf8')); config.port = config.port || 7777; config.host = config.host || 'localhost'; // Configure logging - TODO make configurable // Set up the logger if (config.logging) { try { winston.remove(winston.transports.Console); winston.add(winston.transports.Console, { colorize: true, level: 'verbose' }); } catch(er) { } var detail, type; for (var i = 0; i < config.logging.length; i++) { detail = config.logging[i]; type = detail.type; delete detail.type; winston.add(winston.transports[type], detail); } } // TODO preparse static instead of using exists // TODO implement command line Loading