Patch: Colored debug

Thiago Macieira thiago at kde.org
Thu Sep 6 18:28:50 BST 2007


Olivier Goffart wrote:
>Le lundi 3 septembre 2007, Thiago Macieira a écrit :
>> Agreed, but kDebug's output is NOT a tty, ever. It's outputting to
>> qt_message_output. That one has the capability of determining whether
>> its output is a TTY or not.
>>
>> The test that Gof added for it has to go away. It's not thread-safe:
>> you're not supposed to call qInstallMsgHandler once the program has
>> started because that function isn't thread-safe, but
>> QDebug/qDebug/kDebug/etc. are supposed to be.
>
>Ah, right, i have not thought about thread safety.
>
>Would it be ok to not use qt_message_output, but fprintf instead ?

You also need to write the Windows code (OutputDebugString) as well as the 
calls to abort() and other interesting stuff (again, Windows-specific).

Just make it not default. People can enable it with an environment 
variable. And it could be interesting to have the coloured output written 
to .xsession-errors (if you're reading it with less -R).

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070906/bc30dc14/attachment.sig>


More information about the kde-core-devel mailing list