Skip to content

Commit

Permalink
Merge branch 'master' of github.com:nodeGame/nodegame-server
Browse files Browse the repository at this point in the history
  • Loading branch information
lmis committed Feb 25, 2015
2 parents 402e06c + 3b41010 commit f1e2011
Showing 1 changed file with 4 additions and 64 deletions.
68 changes: 4 additions & 64 deletions lib/Logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,76 +54,16 @@ function Logger(logger, options) {
* @param {string|Number} level The log level for this log
*/
Logger.prototype.log = function(text, level) {
if ('string' !== typeof text) {
text = JSON.stringify(text);
}

level = level || 'info';

// if ('string' === typeof level) {
// level = ServerLog.verbosity_levels[level];
// }

if (this.name) {
//this.logger.log(level, this.name, text);
this.logger.log(level, text, {name: this.name});
this.logger.log(level, text, {name: this.name});
}
else {
this.logger.log(level, text);
}
};




///**
//* ### ServerLog.checkLogDir
//*
//* Creates the log directory if not existing
//*
//*/
//ServerLog.prototype.checkLogDir = function() {
// // skip warning for node 8
// if ('undefined' !== typeof fs.existsSync) {
// if (!fs.existsSync(this.logdir)) {
// fs.mkdirSync(this.logdir, 0755);
// }
// }
// else if (!path.existsSync(this.logdir)) {
// fs.mkdirSync(this.logdir, 0755);
// }
//};


///**
//* ### ServerLog.console
//*
//* Fancifies the output to console
//*
//* @param {object|string} data The text to log
//* @param {string} type A flag that determines the color of the output
//*/
//ServerLog.prototype.console = function(data, type){
//
// var ATT = '0;32m'; // green text;
//
// switch (type) {
//
// case 'ERR':
// ATT = '0;31m'; // red text;
// break;
//
// case 'WARN':
// ATT = '0;37m'; // gray text;
// break;
// }
//
// util.log("\033[" + ATT + this.name + '\t' + data.toString() + "\033[0m");
//};
//
///**
// * ### ServerLog.close
// *
// * Closes open output streams
// */
//ServerLog.prototype.close = function() {
// if (this.logSysStream) this.logSysStream.close();
// if (this.logMsgStream) this.logMsgStream.close();
//};

0 comments on commit f1e2011

Please sign in to comment.