Comparing version 0.8.9 to 0.8.11
@@ -86,3 +86,3 @@ "use strict"; | ||
level : 'log', | ||
methods : [ 'log', 'trace', 'debug', 'info', 'warn', 'error' ], | ||
methods : [ 'log', 'trace', 'debug', 'info', 'warn', 'error', 'fatal' ], | ||
stackIndex : 0, // get the specified index of stack as file information. It is userful for development package. | ||
@@ -89,0 +89,0 @@ inspectOpt : { |
@@ -44,12 +44,2 @@ "use strict"; | ||
function _push2File(str, title) { | ||
var logFile = _logMap[title], now = dateFormat(new Date(), _conf.splitFormat); | ||
if (logFile && logFile.date != now) { | ||
logFile.destroy(); | ||
logFile = null; | ||
} | ||
if (!logFile) { | ||
logFile = _logMap[title] = new LogFile(title, now); | ||
spawn('find', [_conf.root, '-type', 'f', '-name', '*.log', '-mtime', '+' + _conf.maxLogFiles, '-exec', 'rm', '{}', '\;']); | ||
} | ||
logFile.write(str); | ||
if (_conf.allLogsFileName) { | ||
@@ -66,2 +56,13 @@ var allLogFile = _logMap.allLogFile, now = dateFormat(new Date(), _conf.splitFormat); | ||
allLogFile.write(str); | ||
} else { | ||
var logFile = _logMap[title], now = dateFormat(new Date(), _conf.splitFormat); | ||
if (logFile && logFile.date != now) { | ||
logFile.destroy(); | ||
logFile = null; | ||
} | ||
if (!logFile) { | ||
logFile = _logMap[title] = new LogFile(title, now); | ||
spawn('find', [_conf.root, '-type', 'f', '-name', '*.log', '-mtime', '+' + _conf.maxLogFiles, '-exec', 'rm', '{}', '\;']); | ||
} | ||
logFile.write(str); | ||
} | ||
@@ -68,0 +69,0 @@ } |
@@ -9,3 +9,3 @@ { | ||
}, | ||
"version": "0.8.9", | ||
"version": "0.8.11", | ||
"author": "LI Long <lilong@gmail.com>", | ||
@@ -12,0 +12,0 @@ "license": "MIT", |
@@ -294,2 +294,3 @@ "use strict"; | ||
assert.ok(!logger.error('hello %s %d %j', 'world', 123, {foo:'bar'}, [1, 2, 3, 4], Object)); | ||
assert.ok(!logger.fatal('hello %s %d %j', 'world', 123, {foo:'bar'}, [1, 2, 3, 4], Object, logger)); | ||
@@ -303,5 +304,5 @@ } | ||
assert.equal(o['file'], 'test.js'); | ||
assert.equal(o['line'], 299); | ||
assert.equal(o['line'], 300); | ||
assert.equal(o['level'], 0); | ||
} | ||
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55397
1123