wook815 / google-glog

Automatically exported from code.google.com/p/google-glog
Other
0 stars 0 forks source link

The buffers don't seem to get periodically flushed to disk #52

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. If you just log a couple of INFO statements, then the first one is logged, 
but the second one is never written even after setting the threshold for how 
long to buffer (e.g. export GLOG_logbufsecs=5).

What is the expected output? What do you see instead?
I would have expected that all logged messages would have been written to disk 
within the logbufsecs period, but instead, the second line doesn't get logged 
until the program is killed.

What version of the product are you using? On what operating system?
0.3.1 on Linux 64 bit

Please provide any additional information below.

Original issue reported on code.google.com by rimck...@gmail.com on 28 Jun 2010 at 1:57

GoogleCodeExporter commented 8 years ago
Yeah, glog doesn't have any internal timers to ensure periodical disk write. 
When a log happens, glog flushes the log if logbufsecs elapsed since the last 
flush. If you don't mind performance so much, you can specify FLAGS_logbufsecs 
= 0 in the top of your code so all logs will be flushed. Or, you may want to 
call FlushLogFiles in your timer thread.

Original comment by shinichi...@gmail.com on 1 Jul 2010 at 6:51