Scrib-local
An adapter for Scrib to write logs into a log file.
npm install scrib scrib-local --save
var Scrib = logger = "local": file: "./data/log.txt" { // Messages with a priority lower or equal 0 won't be logged return messagepriority > 0; } { ife throw e; logger; logger; };
Then your log file will look like (you can modify it using the format
option):
[Thu, 01 Aug 2013 19:21:41 GMT] 3 MSG (Logs): Message {"42":true}
[Thu, 01 Aug 2013 19:21:41 GMT] 1 MSG_2 (Logs): Message2 {"node":"up"}
Options
file
: A path relative to your current file to the log fileflags = "a+"
: File flags to open file withfilter = null
: A function called with every message to filter themformat = null
: A function called with every filtered message to return a string to write to the file
Testing
git clone git://github.com/Acconut/scrib-local.git
cd scrib-local
npm install
npm test
Licensed under the MIT License.