|
From: | Rob Savoye |
Subject: | [Gnash-dev] new logging system |
Date: | Sat, 11 Mar 2006 12:37:18 -0700 |
User-agent: | Mozilla Thunderbird 1.0.7 (X11/20051013) |
log_msg("Turn on the lights!\n"); dbglogfile << "Hello World " << counter++ << " times!" << endl;The main advantage of this new logging system is it optionally writes everything to disk, handles C++ objects, and supports multiple levels of verbosity. All output lines can optionally be timestamped as well, but I left this turned off for the log_msg() wrappers so they behave the same as always.
This system also supports a simple TRACE macro that hooks itself into the constructor/destructor to print "enter" or "return". This is enabled by putting a GNASH_REPORT_FUNCTION; in the top of a C++ method. These will only appear at the highest level of verbosity, which right now is 1. One other nice feature is it's possible to have multiple debug logs, and you can have things get always printed to the log, but optionally be printed to the screen.
This logging system is styled on the one we wrote for eCOS, and I think way superior to printfs... I'm so sick of having to add "c_str() just to print a string".
The current default is to always write the debug log to disk, I can change this if anyone wants. We should also decide if all output lines should be timestamped or not. The logfile gets written to the current directory, or your home directory when using the plugin.
- rob -
[Prev in Thread] | Current Thread | [Next in Thread] |