From: Martin M. <num...@gm...> - 2005-08-23 13:39:33
|
Is there some way I can get webkit to stop buffering the log file? I'm printing various things to stdout as a method of debugging and sometimes I have to restart the daemon twice before I get the output I'm waiting for. I'm running webware 0.8.1 Martin |
From: Oliver B. <ol...@g7...> - 2005-08-23 22:51:14
|
Hi Martin, I have tried to fix this myself for the reason you gave and because output from stderr and stdout become interleaved in my logs because sys.stdout is flushed on block (rather than line) boundaries. This makes automatic analysis of the log files very difficult. I have tried two things: 1. Set sys.stdout = sys.stderr 2. Flush sys.stdout before writing to sys.stderr. (This is easy for me because all my logging goes via one utility function.) Both of these techniques will fix the first problem, but there is still some interleaving in the log file because ThreadedAppServer prints log lines in multiple parts. e.g. it will print the line 640 0.00 secs /v003/?_s=airservices&_id=check_working.remote using two different print statements. Because two print statements are used, sys.stdout.write() is called twice, which leaves opportunity for another thread to add something to the log file in between. It would be nice if WebKit saved up its information until it had an entire line ready to print. Unfortunately I haven't yet bitten the bullet and moved from 0.81 so I don't want to fiddle with that code. Oliver -- Martin Matusiak wrote: >Is there some way I can get webkit to stop buffering the log file? I'm >printing various things to stdout as a method of debugging and sometimes I >have to restart the daemon twice before I get the output I'm waiting for. > >I'm running webware 0.8.1 > > >Martin > > >------------------------------------------------------- >SF.Net email is Sponsored by the Better Software Conference & EXPO >September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices >Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA >Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf >_______________________________________________ >Webware-discuss mailing list >Web...@li... >https://lists.sourceforge.net/lists/listinfo/webware-discuss > > > |
From: Chuck E. <chu...@gm...> - 2005-08-24 01:08:02
|
On 8/23/05, Oliver Bock <ol...@g7...> wrote: [snip] > Both of these techniques will fix the first problem, but there is still > some interleaving in the log file because ThreadedAppServer prints log > lines in multiple parts. e.g. it will print the line >=20 > 640 0.00 secs /v003/?_s=3Dairservices&_id=3Dcheck_working.r= emote >=20 > using two different print statements. Because two print statements are > used, sys.stdout.write() is called twice, which leaves opportunity for > another thread to add something to the log file in between. It would be > nice if WebKit saved up its information until it had an entire line > ready to print. Unfortunately I haven't yet bitten the bullet and moved > from 0.81 so I don't want to fiddle with that code. I fixed this is in my workspace and checked in just now, so this will make the next 0.9 beta release. Btw I'm using 0.9 in all my projects now. Thanks for the feedback, -Chuck |