On samedi 17 avril 2021 17:40:07 CEST Chris Cannam wrote:
> On Sat, 17 Apr 2021, at 15:59, David Faure wrote:
> > Instead of the RG_DEBUG macro "hack", I recommend using qCDebug() to make
> > it possible to enable/disable debug output by category.
>
> Can anyone recall why we introduced the RG_DEBUG macros in the first place?
> Our debug was always a wrapper for QDebug, so there must have been some
> limitation of QDebug that we wanted to work around rather than (e.g.)
> wanting something that could be used separately from Qt. But I don't
> remember what that limitation was.
I'm pretty sure that the limitation was that qDebug() is fully on or off.
You either get a lot of noise from all parts of the code, or complete silence
(apart from warnings and errors).
See how src/gui/editors/parameters/MIDIInstrumentParameterPanel.cpp
does RG_NO_DEBUG_PRINT in order to disable RG_DEBUG output from that
particular file.
The other feature from RG_DEBUG is to print that "module string", which
represents the context in which the debug statement is. This is also part of
the categorized logging feature, provided that one adds %{category}
to QT_MESSAGE_PATTERN (we could do that by default in main(), if the env var
isn't set).
> I was wondering about this recently in the context of another project in
> which I used (cargo-culted really) something similar to the RG mechanism,
> then found I couldn't remember what the advantage of it was supposed to be!
:-)
--
David Faure, [email protected], http://www.davidfaure.fr
Working on KDE Frameworks 5
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel