pingus-devel
[Top][All Lists]
Advanced

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

Re: Creating custom debug streams


From: Kenneth Gangstoe
Subject: Re: Creating custom debug streams
Date: Wed, 5 Jun 2002 20:16:38 +0200
User-agent: Mutt/1.3.24i

Btw, ClanLib itself lacks a proper debug tool like this.
If this gets flexible enough, why not put it into ClanLib itself?

- Kenneth

Quoting Ingo Ruhnke (address@hidden):
> 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
> 
> _______________________________________________
> Pingus-Devel mailing list
> address@hidden
> http://mail.freesoftware.fsf.org/mailman/listinfo/pingus-devel



reply via email to

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