Patch: Colored debug

David Jarvie lists at astrojar.org.uk
Fri Aug 31 10:57:25 BST 2007


On Thursday 30 August 2007 23:42, Allen Winter wrote:
> On Wednesday 29 August 2007 7:07:37 pm 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 ?
>>
>>
>> The small problem I have is that I'm not 100% sure the debug will be
>> printed
>> on stderr, since a custom QtMsgHandler could override that.
>> one solution Matthias Kretz proposed is to do
>> QtMsgHandler old = qInstallMsgHandler( 0L );
>> if(!old)  colored=isatty( fileno(stderr) );
>> else   qInstallMsgHandler( old );
>> This is a hack, and i don't think it will be required since I don't know
>> why a
>> KDE application could install message handler.
>>
>
> Personally, I like the idea.
> Maybe the kdebugdialog could be extended to turn-on/turn-off colors
> and also increase/decrease debug print "verbosity".

I like this as well. Using kdebugdialog to control verbosity and colours
(and allowing colours to be selected - the default one may not necessarily
work against some konsole background colours) is also a very good idea.

-- 
David Jarvie.
KAlarm author & maintainer.
http://www.astrojar.org.uk/kalarm





More information about the kde-core-devel mailing list