I'm not sure how I'm supposed to use this package. I've followed the example code from the docs:
var fs = require('fs')
, Log = require('log')
, log = new Log('debug', fs.createWriteStream('my.log'));
But then what? How do I send actual log info to the file? I want what normally gets logged with console.log() to go to the file.
edit: here's the context that I am using it in, as a minimal example. log.info() works fine outside of the while. As it is below, the file is created but has nothing in it.
var fs = require('fs')
var Log = require('log')
var log = new Log('info', fs.createWriteStream('my.log'));
while(true) {
log.info("testing");
}
while (true)like that in Node.js, it blocks the event loop preventing any I/O (like writing to a file) from happening.