Patch: Colored debug
Jason 'vanRijn' Kasper
vr at movingparts.net
Fri Aug 31 12:10:00 BST 2007
On Friday 31 August 2007, Thiago Macieira wrote:
> On Friday 31 August 2007 03:31:11 Andreas Hartmetz wrote:
> > On Thursday 30 August 2007 01:07:37 Olivier Goffart wrote:
> > > Hi,
> > >
> > > I'd like to commit the attached patch.
> > > It does coloration of the kdebug stream as seen on the screenshot
> > > http://bepointbe.be/files/tmp/kdebug1.png
> > >
> > > I think it make the debug output much more easier to read.
> > >
> > > Is there any objections ? or do you want more colors ?
> >
> > I actually think that this is a great idea. While the text terminal is
> > still the most powerful tool for some things there is no reason to
> > pretend that it's still connected to a teletype (that's where "tty" comes
> > from) that hammers black and white letters on paper. We should always use
> > every facility available to us on the vast majority of systems, and
> > colorful text is one of them. Go for it.
> > Could you also make kWarning()'s (or whatever its name is) output red,
> > bold or whatever? Warnings are more interesting if used correctly so they
> > should stand out. If there's a warning there is a nontrivial chance that
> > things are, actually, going really wrong.
> > Thanks in advance :)
>
> Mind you: the output is going through QDebug, which means it's handled by
> qt_message_output. And the output from that can be redirected by installing
> a message handler (qInstallMsgHandler).
>
> All QtTest-based testcases have a message handler installed, so be careful
> with what you're outputting. I somehow doubt that we want ANSI colouring in
> XML.
Is it necessary to put this into the code directly when there are already
standalone tools that do this? I've been using grc to do this for years and
it does the job quite well and it even has the ability to add custom
configuration files (conf.kdebug perhaps?). For example, I use "grc
tail -F /var/log/{maillog,messages,mail/info,mail,warn,acpid}&" and end up
with a very nicely-colorized output shown here:
http://www.flickr.com/photo_zoom.gne?id=1284102997&size=o
Or am I missing something simple?
--
-[ Jason 'vanRijn' Kasper // http://movingparts.net ]-
-[ KDE PIM Developer // http://www.kde.org ]-
-[ bash fun -> :(){ :|:&};: // Numbers 6:22-26 ]-
More information about the kde-core-devel
mailing list