pingus-devel
[Top][All Lists]
Advanced

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

Re: Creating custom debug streams


From: Ingo Ruhnke
Subject: Re: Creating custom debug streams
Date: 05 Jun 2002 20:11:42 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

David Philippi <address@hidden> writes:

> I've just checked what really is to do to create custom debug streams.
> In fact, cout and cerr are nothing other then extern fostreams. So to create 
> a new warning stream, it's sufficient to use simply:
>
> ostream & warn() { return cout << "Insert some custom prefix"; }
 
I just implement it with a custom streambuf, which is a bit more
flexible.

> would be enough. From there on it's easy to create arbitrary configuration 
> mechanisms to change the behaviour of the debug streams.
> The questions to the design I see are:
> 
> - Configurability: 
>   - compile time [ sure *g* ]
>   - start time (commandline arguments)  [ very probably usefull ]
>   - runtime [ don't know ]

start time, runtime maybe later if we have a GUI for configuration
options (well, we already have one, but that sucks). compile time
configuration sucks and should be avoided if possible.

> - Number of custom streams
>   - debug
>   - warn

One stream for warning (pwarn) and one for errors (perr). Done.

>   - trace

ptrace?  Hm, could lead to a name conflict with ptrace(2).

>   - profiling

pprof

>   - component specific
 
We could flag them for the components:

pwarn(PINGUS_SOUND) << ...
pwarn(PINGUS_DISPLAY) << ...

> - Capabilities:
>   - prefix with some text (could also mean special controlcodes)

Done.

>   - redirect to stdout / stderr / file / other stream (multiplexing)

Done.

>   - mask out

not done.

-- 
Advent:     http://www.freesoftware.fsf.org/advent/
Feuerkraft: http://www.freesoftware.fsf.org/feuerkraft/
Pingus:     http://pingus.seul.org/           || ICQ:      59461927
Home:       http://pingus.seul.org/~grumbel/  || JabberID: address@hidden



reply via email to

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