pixl-logger
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -118,3 +118,9 @@ // Generic Logger Class for Node.JS | ||
if (this.echoer) { | ||
this.echoer( line, cols, this.args ); | ||
if (typeof(this.echoer) == 'function') { | ||
this.echoer( line, cols, this.args ); | ||
} | ||
else if (typeof(this.echoer) == 'string') { | ||
if (this.args.sync) fs.appendFileSync(this.echoer, line); | ||
else fs.appendFile(this.echoer, line, function() {}); | ||
} | ||
} | ||
@@ -137,2 +143,5 @@ else if (this.args.color) { | ||
} | ||
// emit row as an event | ||
this.emit( 'row', line, cols, this.args ); | ||
}, | ||
@@ -139,0 +148,0 @@ |
{ | ||
"name": "pixl-logger", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "A simple logging class which generates [bracket][delimited] log columns.", | ||
@@ -25,6 +25,6 @@ "author": "Joseph Huckaby <jhuckaby@gmail.com>", | ||
"chalk": "^1.1.1", | ||
"pixl-class": ">=1.0.0", | ||
"pixl-tools": ">=1.0.0" | ||
"pixl-class": "^1.0.0", | ||
"pixl-tools": "^1.0.0" | ||
}, | ||
"devDependencies": {} | ||
} |
@@ -275,2 +275,4 @@ # Overview | ||
If you specify a filesystem path as the `echoer` instead of a function, it will be appended to. Using this technique you can have the logger append to two different log files at once (the primary log and the echoer log). This file append honors the `sync` flag as well. | ||
Note that your `echoer` hook is only ever called if [Echo to Console](#echo-to-console) mode is enabled. | ||
@@ -277,0 +279,0 @@ |
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
26319
286
350
Updatedpixl-class@^1.0.0
Updatedpixl-tools@^1.0.0