Qt Extended Home · Index · Classes · Headers · Overviews codeless banner

<trace.h> - <trace.h>

The <trace.h> header contains some useful debugging macros. More...

Macros

The <trace.h> header contains some useful debugging macros.

You use the macros in this file like this.

    void MyClass::MyFunc()
    {
        TRACE(TRACE) << "MyClass::MyFunc";

        otherfunc( 1 );
    }
    void MyClass::otherfunc( int arg )
    {
        TRACE(TRACE) << "MyClass::otherfunc" << "arg" << arg;
        LOG() << "Message";
    }

The output looks like this.

    T1 MyClass::MyFunc()
    T1 {
    T1     MyClass::otherfunc() arg 1
    T1     {
    T1         Message
    T1     }
    T1 }

For each new thread seen, the number is incremented (eg. T2, T3, etc.).


Macro Documentation

LOG ()

Use this macro like qDebug() and the output will be indented.

TRACE ( CATEGORY )

Register the logging category to use (TRACE if CATEGORY is null). This statement must appear before calls to LOG() so that indenting happens correctly. See <qtopiadesktoplog.h> for the available categories.

WARNING ()

Use this macro like qWarning() and the output will be indented. Note that calls to WARNING() cannot be turned off like calls to LOG().


Copyright © 2009 Trolltech
Qt Extended Sync Agent Documentation