E
Eric LIn
I'm trying to use Ruby's built-in Logger facility, and I'm not able to
make it output log messages in real-time. Instead, log messages are
only outputted when I call Logger#close.
The Logger is created with a line like this:
log = Logger.new(File.open('test.log', File::WRONLY | File::APPEND
| File::CREAT))
Then I log things using lines like:
log.info('hello')
tail -f test.log shows nothing.
It's only when I call "l.close" that all the log messages get written
out.
My suspicion is I'm not instantiating File correctly. Perhaps there
is an option for unbuffered output?
Any help appreciated.
Eric
make it output log messages in real-time. Instead, log messages are
only outputted when I call Logger#close.
The Logger is created with a line like this:
log = Logger.new(File.open('test.log', File::WRONLY | File::APPEND
| File::CREAT))
Then I log things using lines like:
log.info('hello')
tail -f test.log shows nothing.
It's only when I call "l.close" that all the log messages get written
out.
My suspicion is I'm not instantiating File correctly. Perhaps there
is an option for unbuffered output?
Any help appreciated.
Eric