Re: [AD] allegro.log in release mode

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 02/06/2015 06:34 PM, Trent Gamblin wrote:
This came up before but I don't remember what was done or planned about it.
I'd like to be able to call al_enable_logging(bool) and enable logging in
release mode (or disable it in debug mode if you wanted to...)

Is the slight overhead of an if statement for every ALLEGRO_DEBUG (etc) call
too much? Should it be hidden behind a second preprocessor directive so
al_enable_logging would only work if Allegro was compiled that way (might be
confusing)?

Anybody have any suggestions that came up before before I start?

Trent


The overhead should be minimal, I'm sure, so I wouldn't worry about adding an additional pre-processing directive (we can always add one in the future anyway, if this proves to be a problem). Please make the API a bit more forward compatible in case we want to set up a verbosity system. This would just involve making it `al_set_logging_verbosity(int level)` with level > 0 just enabling logging for now. This would be set to 1 by default in debug builds, and 0 otherwise. Also, I don't know if it's an option right now, but perhaps a function to set the location of the logging file might be useful.

-SL




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/