[Kde-perl] introducing debugging channels

Germain Garand kde-perl@mail.kde.org
Mon, 2 Dec 2002 23:17:17 +0000


Hi people,
PerlQt's debugging output was really getting on my nerves lately. It was=20
always either too much verbose or not enough, or whatever *but* what you'=
d=20
have expected.
So here come debugging channels.

Now, you'd just put a "use Qt::debug;" statement where you want (and/or t=
urn=20
it off scopewise with "no debug;") and you'd have the two default channel=
s=20
activated ("verbose" and "ambiguous").

Currently selectable channels (eg: "use Qt::debug qw|gc calls virtual|" )=
 :

ambiguous :   Reports all ambiguous function/enum calls
verbose   :   Give some more helpfull hints to the developer
gc        :   Garbage collection. Tells you when objects are deleted
calls     :   Tells you what Qt method/function gets called
autoload  :   (not sure if you want to know)=20
virtual   :   Whenever a virtual function tries to access its Perl=20
              reimplementation, you'll know.
all       :   Just what it says.


'verbose' is great when you make a mistake : it will try hard to find a c=
lose=20
match in the relevant class, and tell you what it found.

Example:=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

use Qt;
use Qt::debug;
$a=3D Qt::Application(\@ARGV);
$a->libraryPath("foo");


--- No method to call for :
        QApplication::libraryPath('foo')
Closer candidates are :
        static void QApplication::addLibraryPath(const QString&)
        static QStringList QApplication::libraryPaths()
        static void QApplication::removeLibraryPath(const QString&)
        static void QApplication::setLibraryPaths(const QStringList&)

at test line 4.

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

Anyway, just try it and tell me if it's helpful or if it lacks something,
I'll concentrate now on polishing the 3.004-RC1, so that we have a rock s=
table=20
release before any eventual reengineering

Germain