On Sat, Oct 12, 2013 at 10:42 AM, David Faure <fa...@kde.org> wrote: > On Wednesday 09 October 2013 15:29:56 Mark wrote: > > Hi, > > > > As you all probably know by now, Qt has included of categorized logging > [1] > > as of 5.2. > > In KDE we've had categorized logging for ages, but while porting to > > Frameworks we started using the "simple" Qt logging q<Debug, Notice and > > Warning>. > > > > However, we now again have categorized logging from within Qt. That makes > > me wonder, do we still need to port back to q<Debug, Notice and Warning> > or > > are we now going to use the categorized versions: qC<Debug, Notice and > > Warning>? > > The latter, especially in libraries. Feel free to start porting kdelibs to > that. > > Ok, cool.
But i still miss one tiny detail.. How can we toggle logging at runtime by using for example kdebugdialog? The example looks like this: // in a header Q_DECLARE_LOGGING_CATEGORY(QT_DRIVER_USB) // in one source file Q_LOGGING_CATEGORY(QT_DRIVER_USB, "qt.driver.usb") // usbEntries() will only be called if QT_DRIVER_USB category is enabled qCDebug(QT_DRIVER_USB) << "devices: " << usbEntries(); It's not even clear to me how to add a new category and enable it with the above macro examples. I can get it working if i do this: QLoggingCategory usbCategory("qt.driver.usb"); usbCategory.setEnabled(QtDebugMsg, true); qCDebug(usbCategory) << "USB driver logging..."; So that works.. but getting "qCDebug(QT_DRIVER_USB)..." to work is something i'm still having trouble with. Still playing with this to get it working.
_______________________________________________ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel