Comparing version 0.0.18 to 0.0.19
17
index.js
@@ -262,9 +262,9 @@ var fs = require('fs'), | ||
getLogPrefix: function () { | ||
if (this.opts['IS_ODP'] == true && this.opts['app']) { | ||
if (this.opts.autoAppName && this.opts._req.CURRENT_APP) { | ||
return this.opts._req.CURRENT_APP; | ||
} | ||
if (this.opts['IS_ODP'] == true) { | ||
return this.opts['app']; | ||
} | ||
else { | ||
if (this.opts._req.CURRENT_APP) { | ||
return this.opts._req.CURRENT_APP; | ||
} | ||
return 'unknow'; | ||
@@ -303,3 +303,3 @@ } | ||
getLogFile: function (intLevel) { | ||
var prefix = this.getLogPrefix(); | ||
var prefix = this.getLogPrefix() || 'yog'; | ||
var logFile = "", | ||
@@ -319,3 +319,3 @@ log_path = ""; | ||
log_path = this.opts['use_sub_dir'] ? | ||
(this.opts['log_path'] + "/" + this.opts['app']) : this.opts['log_path']; | ||
(this.opts['log_path'] + "/" + prefix) : this.opts['log_path']; | ||
logFile = prefix; | ||
@@ -389,3 +389,4 @@ } | ||
fdCache[oldFile].end(); | ||
} catch (e) {} | ||
} | ||
catch (e) {} | ||
delete fdCache[oldFile]; | ||
@@ -716,2 +717,2 @@ } | ||
} | ||
}; | ||
}; |
{ | ||
"name": "yog-log", | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"description": "yog logger", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
73565
1296