[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: kdWarning numbers
From:       David Faure <david () mandrakesoft ! com>
Date:       2002-11-20 9:11:38
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 20 November 2002 04:52, Fred Malabre wrote:
> Hi,
> 
> kdWarning take an int as an argument, and it is used to print the name of the 
> class (?) which issues the warning.
> How do you register a new class with an int?
> 
> I noticed the HTML filter print the warnings as a csv filter, with the number 
> 30501.

I just added some more info to http://developer.kde.org/documentation/other/developer-faq.html#q102

Since the website takes some time to update, I attached the relevant part.

- -- 
David FAURE, david@mandrakesoft.com, faure@kde.org
http://people.mandrakesoft.com/~david/
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
Get the latest KOffice - http://download.kde.org/stable/koffice-1.2/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE921HK72KcVAmwbhARAqVfAKCQblf6mLZaASQ98Kag2sqZJSivfACfV5Ro
cmYo9yYxuyh3XBRI91I8/Pc=
=7rbx
-----END PGP SIGNATURE-----

["q102.html" (text/html)]

    <h3>Q: <a id="q102" name="q102">Is there a preferred way to print
    debug output on stderr ?</a></h3>
    Yes, you must use kdDebug():<br />
    <code>kdDebug() &lt;&lt; "KMyApp just started" &lt;&lt;
    endl;</code>·

    <p>The syntax is much like cout, you can use many native types
    between the "&lt;&lt;". This will print out a debugging
    message, which will automatically be turned off at release time
    (by --disable-debug). In case you want the message to still be
    there during releases, because it's a warning or an error, use
    kdWarning() or kdError().</p>

    <p>Components and libraries are advised to use a debug area
    number, as in kdDebug(1234). For this, the number must be registered
    in kdelibs/kdecore/kdebug.areas.
    Debug areas make it possible to turn off
    or on the debug output for specific area numbers, using the
    "kdebugdialog" program, which is part of kdebase. "kdebugdialog
    --fullmode" also permits to control where to log debug
    output. It is usually not necessary to register area numbers
    for standalone applications, unless it's so complex that you want
    to divide the output into several areas.</p>

    <p>To make it clear: <b>do NOT use qDebug()</b>, this one
    doesn't get disabled at releases. Also avoid using assert() or
    kdFatal() which lead to a crash when something goes wrong,
    never nice for the user. Better detect the error, output a
    kdWarning or kdError, and recover if possible.</p>


_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic