gnash-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-dev] Logging code


From: strk
Subject: Re: [Gnash-dev] Logging code
Date: Mon, 7 Aug 2006 21:21:32 +0200

I think wrapping into IF_VERBOSE_WHAT() macro can be a good
first step, then we'll switch to C++ style calls.
Before proceeding it's worth cleanly define these macros.

We currently have these means of debugging:

 assert         - unexpected inconsistencies/code errors
 log_msg        - informative messages (debugging)
 log_action     - like log_msg but for the specific target of actions
 log_processing - like log_msg but for the specific target of parsing
 log_error      - malformed SWF for which no workaround is known ?
 log_warning    - malformed SWF for which a workaround is known ?

Assertions are easily dropped (NDEBUG).
For log_msg, log_action and log_processing we might reintroduce
in order: IF_VERBOSE, IF_VERBOSE_ACTION, IF_VERBOSE_PARSE.

I think we can safely keep log_error and log_warning atm.

What do you think ?

--strk;


On Mon, Aug 07, 2006 at 12:55:49PM -0600, Rob Savoye wrote:
> strk wrote:
> > I've been thinking again about this, and mayne C++ stream
> > is not really a good idea.
> 
>   Performance wise using streams is always a bad idea, but it's very
> useful for debug logs in C++ programs because it can print C++ objects
> directly. The advantages of a C API for debug logging are simplicity,
> but I get really tired of having to convert everything to something that
> can be printed by printf().
> 
> > The con is that every << is a new function call, and
> > it won't be easy to prepend WARNING, ERROR etc to the call.
> 
>   The idea was to have a class derived from LogFile for warning, errors,
> etc ... so you'd use "errlog << foo" or something like that. I'll admit
> I'd like to see the current debug logging system improved in some way to
> handle errors and warnings, plus to be more performance oriented.
> 
>   We could wrap all the debugging in a macro like IF_ACTION() was before
> I changed it that would remove those statements. I think a multitude of
> macros with variables arguments is a mess. One advantage of the varargs
> or streaming is you can print as much as you want.
> 
>       - rob -
> 
> 
> 
> 
> _______________________________________________
> Gnash-dev mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/gnash-dev

-- 

 /"\    ASCII Ribbon Campaign
 \ /    Respect for low technology.
  X     Keep e-mail messages readable by any computer system.
 / \    Keep it ASCII. 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]