diff --git a/src/core/chromepalette.cpp b/src/core/chromepalette.cpp index de6cc168..e4afd7c1 100644 --- a/src/core/chromepalette.cpp +++ b/src/core/chromepalette.cpp @@ -30,10 +30,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcChromePalette, "wangwenx190.framelesshelper.core.chromepalette") -#define INFO qCInfo(lcChromePalette) -#define DEBUG qCDebug(lcChromePalette) -#define WARNING qCWarning(lcChromePalette) -#define CRITICAL qCCritical(lcChromePalette) + +#ifdef FRAMELESSHELPER_CORE_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcChromePalette) +# define DEBUG qCDebug(lcChromePalette) +# define WARNING qCWarning(lcChromePalette) +# define CRITICAL qCCritical(lcChromePalette) +#endif using namespace Global; diff --git a/src/core/framelessconfig.cpp b/src/core/framelessconfig.cpp index 864e0b5e..662bf1fd 100644 --- a/src/core/framelessconfig.cpp +++ b/src/core/framelessconfig.cpp @@ -31,10 +31,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcFramelessConfig, "wangwenx190.framelesshelper.core.framelessconfig") -#define INFO qCInfo(lcFramelessConfig) -#define DEBUG qCDebug(lcFramelessConfig) -#define WARNING qCWarning(lcFramelessConfig) -#define CRITICAL qCCritical(lcFramelessConfig) + +#ifdef FRAMELESSHELPER_CORE_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcFramelessConfig) +# define DEBUG qCDebug(lcFramelessConfig) +# define WARNING qCWarning(lcFramelessConfig) +# define CRITICAL qCCritical(lcFramelessConfig) +#endif using namespace Global; diff --git a/src/core/framelesshelper_qt.cpp b/src/core/framelesshelper_qt.cpp index a8106e12..f7bb7f3e 100644 --- a/src/core/framelesshelper_qt.cpp +++ b/src/core/framelesshelper_qt.cpp @@ -34,10 +34,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcFramelessHelperQt, "wangwenx190.framelesshelper.core.impl.qt") -#define INFO qCInfo(lcFramelessHelperQt) -#define DEBUG qCDebug(lcFramelessHelperQt) -#define WARNING qCWarning(lcFramelessHelperQt) -#define CRITICAL qCCritical(lcFramelessHelperQt) + +#ifdef FRAMELESSHELPER_CORE_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcFramelessHelperQt) +# define DEBUG qCDebug(lcFramelessHelperQt) +# define WARNING qCWarning(lcFramelessHelperQt) +# define CRITICAL qCCritical(lcFramelessHelperQt) +#endif using namespace Global; diff --git a/src/core/framelesshelper_win.cpp b/src/core/framelesshelper_win.cpp index e9282773..63e318e5 100644 --- a/src/core/framelesshelper_win.cpp +++ b/src/core/framelesshelper_win.cpp @@ -38,10 +38,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcFramelessHelperWin, "wangwenx190.framelesshelper.core.impl.win") -#define INFO qCInfo(lcFramelessHelperWin) -#define DEBUG qCDebug(lcFramelessHelperWin) -#define WARNING qCWarning(lcFramelessHelperWin) -#define CRITICAL qCCritical(lcFramelessHelperWin) + +#ifdef FRAMELESSHELPER_CORE_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcFramelessHelperWin) +# define DEBUG qCDebug(lcFramelessHelperWin) +# define WARNING qCWarning(lcFramelessHelperWin) +# define CRITICAL qCCritical(lcFramelessHelperWin) +#endif using namespace Global; diff --git a/src/core/framelesshelpercore_global.cpp b/src/core/framelesshelpercore_global.cpp index f7c71a92..9d50f00e 100644 --- a/src/core/framelesshelpercore_global.cpp +++ b/src/core/framelesshelpercore_global.cpp @@ -75,10 +75,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcCoreGlobal, "wangwenx190.framelesshelper.core.global") -#define INFO qCInfo(lcCoreGlobal) -#define DEBUG qCDebug(lcCoreGlobal) -#define WARNING qCWarning(lcCoreGlobal) -#define CRITICAL qCCritical(lcCoreGlobal) + +#ifdef FRAMELESSHELPER_CORE_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcCoreGlobal) +# define DEBUG qCDebug(lcCoreGlobal) +# define WARNING qCWarning(lcCoreGlobal) +# define CRITICAL qCCritical(lcCoreGlobal) +#endif using namespace Global; @@ -96,40 +104,16 @@ FRAMELESSHELPER_BYTEARRAY_CONSTANT(xcb) #endif [[maybe_unused]] static constexpr const char kNoLogoEnvVar[] = "FRAMELESSHELPER_NO_LOGO"; -FRAMELESSHELPER_STRING_CONSTANT2(FramelessHelperLogPrefix, "wangwenx190.framelesshelper.") struct CoreData { QMutex mutex; QList initHooks = {}; QList uninitHooks = {}; - QLoggingCategory::CategoryFilter oldCategoryFilter = nullptr; }; Q_GLOBAL_STATIC(CoreData, coreData) -[[maybe_unused]] static inline void flhCategoryFilter(QLoggingCategory *category) -{ - Q_ASSERT(category); - if (!category) { - return; - } - coreData()->mutex.lock(); - if (coreData()->oldCategoryFilter) { - coreData()->oldCategoryFilter(category); - } - coreData()->mutex.unlock(); - const QString categoryName = QUtf8String(category->categoryName()); - if (!categoryName.isEmpty() - && categoryName.startsWith(kFramelessHelperLogPrefix, Qt::CaseInsensitive)) { - category->setEnabled(QtInfoMsg, false); - category->setEnabled(QtDebugMsg, false); - category->setEnabled(QtWarningMsg, false); - category->setEnabled(QtCriticalMsg, false); - // QtFatalMsg cannot be changed; it will always remain true. - } -} - namespace FramelessHelper::Core { @@ -141,12 +125,6 @@ void initialize() } inited = true; -#ifdef FRAMELESSHELPER_CORE_NO_DEBUG_OUTPUT - coreData()->mutex.lock(); - coreData()->oldCategoryFilter = QLoggingCategory::installFilter(flhCategoryFilter); - coreData()->mutex.unlock(); -#endif - outputLogo(); #ifdef Q_OS_LINUX diff --git a/src/core/framelessmanager.cpp b/src/core/framelessmanager.cpp index d88675b1..f7130597 100644 --- a/src/core/framelessmanager.cpp +++ b/src/core/framelessmanager.cpp @@ -52,10 +52,18 @@ static inline void initResource() FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcFramelessManager, "wangwenx190.framelesshelper.core.framelessmanager") -#define INFO qCInfo(lcFramelessManager) -#define DEBUG qCDebug(lcFramelessManager) -#define WARNING qCWarning(lcFramelessManager) -#define CRITICAL qCCritical(lcFramelessManager) + +#ifdef FRAMELESSHELPER_CORE_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcFramelessManager) +# define DEBUG qCDebug(lcFramelessManager) +# define WARNING qCWarning(lcFramelessManager) +# define CRITICAL qCCritical(lcFramelessManager) +#endif using namespace Global; diff --git a/src/core/micamaterial.cpp b/src/core/micamaterial.cpp index e0f11c14..f34841b4 100644 --- a/src/core/micamaterial.cpp +++ b/src/core/micamaterial.cpp @@ -49,10 +49,18 @@ static inline void initResource() FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcMicaMaterial, "wangwenx190.framelesshelper.core.micamaterial") -#define INFO qCInfo(lcMicaMaterial) -#define DEBUG qCDebug(lcMicaMaterial) -#define WARNING qCWarning(lcMicaMaterial) -#define CRITICAL qCCritical(lcMicaMaterial) + +#ifdef FRAMELESSHELPER_CORE_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcMicaMaterial) +# define DEBUG qCDebug(lcMicaMaterial) +# define WARNING qCWarning(lcMicaMaterial) +# define CRITICAL qCCritical(lcMicaMaterial) +#endif using namespace Global; diff --git a/src/core/registrykey.cpp b/src/core/registrykey.cpp index 77bddaf4..0db9be8c 100644 --- a/src/core/registrykey.cpp +++ b/src/core/registrykey.cpp @@ -33,10 +33,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcCoreRegistryKey, "wangwenx190.framelesshelper.core.registrykey") -#define INFO qCInfo(lcCoreRegistryKey) -#define DEBUG qCDebug(lcCoreRegistryKey) -#define WARNING qCWarning(lcCoreRegistryKey) -#define CRITICAL qCCritical(lcCoreRegistryKey) + +#ifdef FRAMELESSHELPER_CORE_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcCoreRegistryKey) +# define DEBUG qCDebug(lcCoreRegistryKey) +# define WARNING qCWarning(lcCoreRegistryKey) +# define CRITICAL qCCritical(lcCoreRegistryKey) +#endif using namespace Global; diff --git a/src/core/sysapiloader.cpp b/src/core/sysapiloader.cpp index def8b84d..11f7a55f 100644 --- a/src/core/sysapiloader.cpp +++ b/src/core/sysapiloader.cpp @@ -34,10 +34,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcSysApiLoader, "wangwenx190.framelesshelper.core.sysapiloader") -#define INFO qCInfo(lcSysApiLoader) -#define DEBUG qCDebug(lcSysApiLoader) -#define WARNING qCWarning(lcSysApiLoader) -#define CRITICAL qCCritical(lcSysApiLoader) + +#ifdef FRAMELESSHELPER_CORE_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcSysApiLoader) +# define DEBUG qCDebug(lcSysApiLoader) +# define WARNING qCWarning(lcSysApiLoader) +# define CRITICAL qCCritical(lcSysApiLoader) +#endif struct SysApiLoaderData { diff --git a/src/core/utils.cpp b/src/core/utils.cpp index c74af56a..d8a88060 100644 --- a/src/core/utils.cpp +++ b/src/core/utils.cpp @@ -39,10 +39,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcUtilsCommon, "wangwenx190.framelesshelper.core.utils.common") -#define INFO qCInfo(lcUtilsCommon) -#define DEBUG qCDebug(lcUtilsCommon) -#define WARNING qCWarning(lcUtilsCommon) -#define CRITICAL qCCritical(lcUtilsCommon) + +#ifdef FRAMELESSHELPER_CORE_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcUtilsCommon) +# define DEBUG qCDebug(lcUtilsCommon) +# define WARNING qCWarning(lcUtilsCommon) +# define CRITICAL qCCritical(lcUtilsCommon) +#endif using namespace Global; diff --git a/src/core/utils_win.cpp b/src/core/utils_win.cpp index 5437b3ae..c68c7896 100644 --- a/src/core/utils_win.cpp +++ b/src/core/utils_win.cpp @@ -575,10 +575,18 @@ Q_DECLARE_METATYPE(QMargins) FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcUtilsWin, "wangwenx190.framelesshelper.core.utils.win") -#define INFO qCInfo(lcUtilsWin) -#define DEBUG qCDebug(lcUtilsWin) -#define WARNING qCWarning(lcUtilsWin) -#define CRITICAL qCCritical(lcUtilsWin) + +#ifdef FRAMELESSHELPER_CORE_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcUtilsWin) +# define DEBUG qCDebug(lcUtilsWin) +# define WARNING qCWarning(lcUtilsWin) +# define CRITICAL qCCritical(lcUtilsWin) +#endif using namespace Global; diff --git a/src/core/windowborderpainter.cpp b/src/core/windowborderpainter.cpp index 76167f08..48e7f81a 100644 --- a/src/core/windowborderpainter.cpp +++ b/src/core/windowborderpainter.cpp @@ -34,10 +34,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcWindowBorderPainter, "wangwenx190.framelesshelper.core.windowborderpainter") -#define INFO qCInfo(lcWindowBorderPainter) -#define DEBUG qCDebug(lcWindowBorderPainter) -#define WARNING qCWarning(lcWindowBorderPainter) -#define CRITICAL qCCritical(lcWindowBorderPainter) + +#ifdef FRAMELESSHELPER_CORE_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcWindowBorderPainter) +# define DEBUG qCDebug(lcWindowBorderPainter) +# define WARNING qCWarning(lcWindowBorderPainter) +# define CRITICAL qCCritical(lcWindowBorderPainter) +#endif using namespace Global; diff --git a/src/quick/framelesshelperquick_global.cpp b/src/quick/framelesshelperquick_global.cpp index 9cdc4cce..e764601e 100644 --- a/src/quick/framelesshelperquick_global.cpp +++ b/src/quick/framelesshelperquick_global.cpp @@ -45,10 +45,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcQuickGlobal, "wangwenx190.framelesshelper.quick.global") -#define INFO qCInfo(lcQuickGlobal) -#define DEBUG qCDebug(lcQuickGlobal) -#define WARNING qCWarning(lcQuickGlobal) -#define CRITICAL qCCritical(lcQuickGlobal) + +#ifdef FRAMELESSHELPER_QUICK_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcQuickGlobal) +# define DEBUG qCDebug(lcQuickGlobal) +# define WARNING qCWarning(lcQuickGlobal) +# define CRITICAL qCCritical(lcQuickGlobal) +#endif QuickGlobal::QuickGlobal(QObject *parent) : QObject(parent) { diff --git a/src/quick/framelessquickapplicationwindow.cpp b/src/quick/framelessquickapplicationwindow.cpp index ab555903..92d088cb 100644 --- a/src/quick/framelessquickapplicationwindow.cpp +++ b/src/quick/framelessquickapplicationwindow.cpp @@ -31,10 +31,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcFramelessQuickApplicationWindow, "wangwenx190.framelesshelper.quick.framelessquickapplicationwindow") -#define INFO qCInfo(lcFramelessQuickApplicationWindow) -#define DEBUG qCDebug(lcFramelessQuickApplicationWindow) -#define WARNING qCWarning(lcFramelessQuickApplicationWindow) -#define CRITICAL qCCritical(lcFramelessQuickApplicationWindow) + +#ifdef FRAMELESSHELPER_QUICK_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcFramelessQuickApplicationWindow) +# define DEBUG qCDebug(lcFramelessQuickApplicationWindow) +# define WARNING qCWarning(lcFramelessQuickApplicationWindow) +# define CRITICAL qCCritical(lcFramelessQuickApplicationWindow) +#endif using namespace Global; diff --git a/src/quick/framelessquickhelper.cpp b/src/quick/framelessquickhelper.cpp index 760d2155..dfcf5d19 100644 --- a/src/quick/framelessquickhelper.cpp +++ b/src/quick/framelessquickhelper.cpp @@ -46,10 +46,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcFramelessQuickHelper, "wangwenx190.framelesshelper.quick.framelessquickhelper") -#define INFO qCInfo(lcFramelessQuickHelper) -#define DEBUG qCDebug(lcFramelessQuickHelper) -#define WARNING qCWarning(lcFramelessQuickHelper) -#define CRITICAL qCCritical(lcFramelessQuickHelper) + +#ifdef FRAMELESSHELPER_QUICK_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcFramelessQuickHelper) +# define DEBUG qCDebug(lcFramelessQuickHelper) +# define WARNING qCWarning(lcFramelessQuickHelper) +# define CRITICAL qCCritical(lcFramelessQuickHelper) +#endif using namespace Global; diff --git a/src/quick/framelessquickmodule.cpp b/src/quick/framelessquickmodule.cpp index 3b961eba..72ea7046 100644 --- a/src/quick/framelessquickmodule.cpp +++ b/src/quick/framelessquickmodule.cpp @@ -51,10 +51,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcQuickModule, "wangwenx190.framelesshelper.quick.quickmodule") -#define INFO qCInfo(lcQuickModule) -#define DEBUG qCDebug(lcQuickModule) -#define WARNING qCWarning(lcQuickModule) -#define CRITICAL qCCritical(lcQuickModule) + +#ifdef FRAMELESSHELPER_QUICK_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcQuickModule) +# define DEBUG qCDebug(lcQuickModule) +# define WARNING qCWarning(lcQuickModule) +# define CRITICAL qCCritical(lcQuickModule) +#endif void FramelessHelper::Quick::registerTypes(QQmlEngine *engine) { diff --git a/src/quick/framelessquickutils.cpp b/src/quick/framelessquickutils.cpp index 69509ad2..82bec4f4 100644 --- a/src/quick/framelessquickutils.cpp +++ b/src/quick/framelessquickutils.cpp @@ -32,10 +32,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcFramelessQuickUtils, "wangwenx190.framelesshelper.quick.framelessquickutils") -#define INFO qCInfo(lcFramelessQuickUtils) -#define DEBUG qCDebug(lcFramelessQuickUtils) -#define WARNING qCWarning(lcFramelessQuickUtils) -#define CRITICAL qCCritical(lcFramelessQuickUtils) + +#ifdef FRAMELESSHELPER_QUICK_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcFramelessQuickUtils) +# define DEBUG qCDebug(lcFramelessQuickUtils) +# define WARNING qCWarning(lcFramelessQuickUtils) +# define CRITICAL qCCritical(lcFramelessQuickUtils) +#endif using namespace Global; diff --git a/src/quick/framelessquickwindow.cpp b/src/quick/framelessquickwindow.cpp index 53476eda..7a12e443 100644 --- a/src/quick/framelessquickwindow.cpp +++ b/src/quick/framelessquickwindow.cpp @@ -31,10 +31,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcFramelessQuickWindow, "wangwenx190.framelesshelper.quick.framelessquickwindow") -#define INFO qCInfo(lcFramelessQuickWindow) -#define DEBUG qCDebug(lcFramelessQuickWindow) -#define WARNING qCWarning(lcFramelessQuickWindow) -#define CRITICAL qCCritical(lcFramelessQuickWindow) + +#ifdef FRAMELESSHELPER_QUICK_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcFramelessQuickWindow) +# define DEBUG qCDebug(lcFramelessQuickWindow) +# define WARNING qCWarning(lcFramelessQuickWindow) +# define CRITICAL qCCritical(lcFramelessQuickWindow) +#endif using namespace Global; diff --git a/src/quick/quickchromepalette.cpp b/src/quick/quickchromepalette.cpp index 51690212..c6bf6a83 100644 --- a/src/quick/quickchromepalette.cpp +++ b/src/quick/quickchromepalette.cpp @@ -27,10 +27,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcQuickChromePalette, "wangwenx190.framelesshelper.quick.quickchromepalette") -#define INFO qCInfo(lcQuickChromePalette) -#define DEBUG qCDebug(lcQuickChromePalette) -#define WARNING qCWarning(lcQuickChromePalette) -#define CRITICAL qCCritical(lcQuickChromePalette) + +#ifdef FRAMELESSHELPER_QUICK_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcQuickChromePalette) +# define DEBUG qCDebug(lcQuickChromePalette) +# define WARNING qCWarning(lcQuickChromePalette) +# define CRITICAL qCCritical(lcQuickChromePalette) +#endif QuickChromePalette::QuickChromePalette(QObject *parent) : ChromePalette(parent) { diff --git a/src/quick/quickimageitem.cpp b/src/quick/quickimageitem.cpp index b6d47cbf..92dae412 100644 --- a/src/quick/quickimageitem.cpp +++ b/src/quick/quickimageitem.cpp @@ -32,10 +32,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcQuickImageItem, "wangwenx190.framelesshelper.quick.quickimageitem") -#define INFO qCInfo(lcQuickImageItem) -#define DEBUG qCDebug(lcQuickImageItem) -#define WARNING qCWarning(lcQuickImageItem) -#define CRITICAL qCCritical(lcQuickImageItem) + +#ifdef FRAMELESSHELPER_QUICK_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcQuickImageItem) +# define DEBUG qCDebug(lcQuickImageItem) +# define WARNING qCWarning(lcQuickImageItem) +# define CRITICAL qCCritical(lcQuickImageItem) +#endif using namespace Global; diff --git a/src/quick/quickmicamaterial.cpp b/src/quick/quickmicamaterial.cpp index 9e66bbb7..c88b6fe9 100644 --- a/src/quick/quickmicamaterial.cpp +++ b/src/quick/quickmicamaterial.cpp @@ -36,10 +36,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcQuickMicaMaterial, "wangwenx190.framelesshelper.quick.quickmicamaterial") -#define INFO qCInfo(lcQuickMicaMaterial) -#define DEBUG qCDebug(lcQuickMicaMaterial) -#define WARNING qCWarning(lcQuickMicaMaterial) -#define CRITICAL qCCritical(lcQuickMicaMaterial) + +#ifdef FRAMELESSHELPER_QUICK_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcQuickMicaMaterial) +# define DEBUG qCDebug(lcQuickMicaMaterial) +# define WARNING qCWarning(lcQuickMicaMaterial) +# define CRITICAL qCCritical(lcQuickMicaMaterial) +#endif using namespace Global; diff --git a/src/quick/quickstandardsystembutton.cpp b/src/quick/quickstandardsystembutton.cpp index b63fe665..a9d1fe1c 100644 --- a/src/quick/quickstandardsystembutton.cpp +++ b/src/quick/quickstandardsystembutton.cpp @@ -36,10 +36,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcQuickStandardSystemButton, "wangwenx190.framelesshelper.quick.quickstandardsystembutton") -#define INFO qCInfo(lcQuickStandardSystemButton) -#define DEBUG qCDebug(lcQuickStandardSystemButton) -#define WARNING qCWarning(lcQuickStandardSystemButton) -#define CRITICAL qCCritical(lcQuickStandardSystemButton) + +#ifdef FRAMELESSHELPER_QUICK_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcQuickStandardSystemButton) +# define DEBUG qCDebug(lcQuickStandardSystemButton) +# define WARNING qCWarning(lcQuickStandardSystemButton) +# define CRITICAL qCCritical(lcQuickStandardSystemButton) +#endif using namespace Global; diff --git a/src/quick/quickstandardtitlebar.cpp b/src/quick/quickstandardtitlebar.cpp index 32ca4686..410dadfa 100644 --- a/src/quick/quickstandardtitlebar.cpp +++ b/src/quick/quickstandardtitlebar.cpp @@ -39,10 +39,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcQuickStandardTitleBar, "wangwenx190.framelesshelper.quick.quickstandardtitlebar") -#define INFO qCInfo(lcQuickStandardTitleBar) -#define DEBUG qCDebug(lcQuickStandardTitleBar) -#define WARNING qCWarning(lcQuickStandardTitleBar) -#define CRITICAL qCCritical(lcQuickStandardTitleBar) + +#ifdef FRAMELESSHELPER_QUICK_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcQuickStandardTitleBar) +# define DEBUG qCDebug(lcQuickStandardTitleBar) +# define WARNING qCWarning(lcQuickStandardTitleBar) +# define CRITICAL qCCritical(lcQuickStandardTitleBar) +#endif using namespace Global; diff --git a/src/quick/quickwindowborder.cpp b/src/quick/quickwindowborder.cpp index 9a9f22a4..c6ccf111 100644 --- a/src/quick/quickwindowborder.cpp +++ b/src/quick/quickwindowborder.cpp @@ -31,10 +31,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcQuickWindowBorder, "wangwenx190.framelesshelper.quick.quickwindowborder") -#define INFO qCInfo(lcQuickWindowBorder) -#define DEBUG qCDebug(lcQuickWindowBorder) -#define WARNING qCWarning(lcQuickWindowBorder) -#define CRITICAL qCCritical(lcQuickWindowBorder) + +#ifdef FRAMELESSHELPER_QUICK_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcQuickWindowBorder) +# define DEBUG qCDebug(lcQuickWindowBorder) +# define WARNING qCWarning(lcQuickWindowBorder) +# define CRITICAL qCCritical(lcQuickWindowBorder) +#endif using namespace Global; diff --git a/src/widgets/framelessdialog.cpp b/src/widgets/framelessdialog.cpp index 6966772a..36ff5267 100644 --- a/src/widgets/framelessdialog.cpp +++ b/src/widgets/framelessdialog.cpp @@ -31,10 +31,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcFramelessDialog, "wangwenx190.framelesshelper.widgets.framelessdialog") -#define INFO qCInfo(lcFramelessDialog) -#define DEBUG qCDebug(lcFramelessDialog) -#define WARNING qCWarning(lcFramelessDialog) -#define CRITICAL qCCritical(lcFramelessDialog) + +#ifdef FRAMELESSHELPER_WIDGETS_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcFramelessDialog) +# define DEBUG qCDebug(lcFramelessDialog) +# define WARNING qCWarning(lcFramelessDialog) +# define CRITICAL qCCritical(lcFramelessDialog) +#endif using namespace Global; diff --git a/src/widgets/framelesshelperwidgets_global.cpp b/src/widgets/framelesshelperwidgets_global.cpp index b644b7a7..78c182ca 100644 --- a/src/widgets/framelesshelperwidgets_global.cpp +++ b/src/widgets/framelesshelperwidgets_global.cpp @@ -40,10 +40,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcWidgetsGlobal, "wangwenx190.framelesshelper.widgets.global") -#define INFO qCInfo(lcWidgetsGlobal) -#define DEBUG qCDebug(lcWidgetsGlobal) -#define WARNING qCWarning(lcWidgetsGlobal) -#define CRITICAL qCCritical(lcWidgetsGlobal) + +#ifdef FRAMELESSHELPER_WIDGETS_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcWidgetsGlobal) +# define DEBUG qCDebug(lcWidgetsGlobal) +# define WARNING qCWarning(lcWidgetsGlobal) +# define CRITICAL qCCritical(lcWidgetsGlobal) +#endif namespace FramelessHelper::Widgets { diff --git a/src/widgets/framelessmainwindow.cpp b/src/widgets/framelessmainwindow.cpp index ea99f37e..3219e404 100644 --- a/src/widgets/framelessmainwindow.cpp +++ b/src/widgets/framelessmainwindow.cpp @@ -31,10 +31,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcFramelessMainWindow, "wangwenx190.framelesshelper.widgets.framelessmainwindow") -#define INFO qCInfo(lcFramelessMainWindow) -#define DEBUG qCDebug(lcFramelessMainWindow) -#define WARNING qCWarning(lcFramelessMainWindow) -#define CRITICAL qCCritical(lcFramelessMainWindow) + +#ifdef FRAMELESSHELPER_WIDGETS_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcFramelessMainWindow) +# define DEBUG qCDebug(lcFramelessMainWindow) +# define WARNING qCWarning(lcFramelessMainWindow) +# define CRITICAL qCCritical(lcFramelessMainWindow) +#endif using namespace Global; diff --git a/src/widgets/framelesswidget.cpp b/src/widgets/framelesswidget.cpp index f028c870..613a18ca 100644 --- a/src/widgets/framelesswidget.cpp +++ b/src/widgets/framelesswidget.cpp @@ -31,10 +31,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcFramelessWidget, "wangwenx190.framelesshelper.widgets.framelesswidget") -#define INFO qCInfo(lcFramelessWidget) -#define DEBUG qCDebug(lcFramelessWidget) -#define WARNING qCWarning(lcFramelessWidget) -#define CRITICAL qCCritical(lcFramelessWidget) + +#ifdef FRAMELESSHELPER_WIDGETS_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcFramelessWidget) +# define DEBUG qCDebug(lcFramelessWidget) +# define WARNING qCWarning(lcFramelessWidget) +# define CRITICAL qCCritical(lcFramelessWidget) +#endif using namespace Global; diff --git a/src/widgets/framelesswidgetshelper.cpp b/src/widgets/framelesswidgetshelper.cpp index 950f90bb..2107dad6 100644 --- a/src/widgets/framelesswidgetshelper.cpp +++ b/src/widgets/framelesswidgetshelper.cpp @@ -44,10 +44,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcFramelessWidgetsHelper, "wangwenx190.framelesshelper.widgets.framelesswidgetshelper") -#define INFO qCInfo(lcFramelessWidgetsHelper) -#define DEBUG qCDebug(lcFramelessWidgetsHelper) -#define WARNING qCWarning(lcFramelessWidgetsHelper) -#define CRITICAL qCCritical(lcFramelessWidgetsHelper) + +#ifdef FRAMELESSHELPER_WIDGETS_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcFramelessWidgetsHelper) +# define DEBUG qCDebug(lcFramelessWidgetsHelper) +# define WARNING qCWarning(lcFramelessWidgetsHelper) +# define CRITICAL qCCritical(lcFramelessWidgetsHelper) +#endif using namespace Global; diff --git a/src/widgets/standardsystembutton.cpp b/src/widgets/standardsystembutton.cpp index 68ec75ec..880d694f 100644 --- a/src/widgets/standardsystembutton.cpp +++ b/src/widgets/standardsystembutton.cpp @@ -33,10 +33,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcStandardSystemButton, "wangwenx190.framelesshelper.widgets.standardsystembutton") -#define INFO qCInfo(lcStandardSystemButton) -#define DEBUG qCDebug(lcStandardSystemButton) -#define WARNING qCWarning(lcStandardSystemButton) -#define CRITICAL qCCritical(lcStandardSystemButton) + +#ifdef FRAMELESSHELPER_WIDGETS_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcStandardSystemButton) +# define DEBUG qCDebug(lcStandardSystemButton) +# define WARNING qCWarning(lcStandardSystemButton) +# define CRITICAL qCCritical(lcStandardSystemButton) +#endif using namespace Global; diff --git a/src/widgets/standardtitlebar.cpp b/src/widgets/standardtitlebar.cpp index a6a9e823..d1bcc023 100644 --- a/src/widgets/standardtitlebar.cpp +++ b/src/widgets/standardtitlebar.cpp @@ -35,10 +35,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcStandardTitleBar, "wangwenx190.framelesshelper.widgets.standardtitlebar") -#define INFO qCInfo(lcStandardTitleBar) -#define DEBUG qCDebug(lcStandardTitleBar) -#define WARNING qCWarning(lcStandardTitleBar) -#define CRITICAL qCCritical(lcStandardTitleBar) + +#ifdef FRAMELESSHELPER_WIDGETS_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcStandardTitleBar) +# define DEBUG qCDebug(lcStandardTitleBar) +# define WARNING qCWarning(lcStandardTitleBar) +# define CRITICAL qCCritical(lcStandardTitleBar) +#endif using namespace Global; diff --git a/src/widgets/widgetssharedhelper.cpp b/src/widgets/widgetssharedhelper.cpp index 4b309e22..cc587734 100644 --- a/src/widgets/widgetssharedhelper.cpp +++ b/src/widgets/widgetssharedhelper.cpp @@ -40,10 +40,18 @@ FRAMELESSHELPER_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcWidgetsSharedHelper, "wangwenx190.framelesshelper.widgets.widgetssharedhelper") -#define INFO qCInfo(lcWidgetsSharedHelper) -#define DEBUG qCDebug(lcWidgetsSharedHelper) -#define WARNING qCWarning(lcWidgetsSharedHelper) -#define CRITICAL qCCritical(lcWidgetsSharedHelper) + +#ifdef FRAMELESSHELPER_WIDGETS_NO_DEBUG_OUTPUT +# define INFO QT_NO_QDEBUG_MACRO() +# define DEBUG QT_NO_QDEBUG_MACRO() +# define WARNING QT_NO_QDEBUG_MACRO() +# define CRITICAL QT_NO_QDEBUG_MACRO() +#else +# define INFO qCInfo(lcWidgetsSharedHelper) +# define DEBUG qCDebug(lcWidgetsSharedHelper) +# define WARNING qCWarning(lcWidgetsSharedHelper) +# define CRITICAL qCCritical(lcWidgetsSharedHelper) +#endif using namespace Global;