File indexing completed on 2025-01-05 03:51:16

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2014-09-08
0007  * Description : digiKam debug spaces
0008  *
0009  * SPDX-FileCopyrightText: 2014      by Laurent Montel <montel at kde dot org>
0010  * SPDX-FileCopyrightText: 2015      by Mohamed_Anwer <m_dot_anwer at gmx dot com>
0011  * SPDX-FileCopyrightText: 2014-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0012  *
0013  * SPDX-License-Identifier: GPL-2.0-or-later
0014  *
0015  * ============================================================ */
0016 
0017 #include "digikam_debug.h"
0018 
0019 // Local includes
0020 
0021 #include "digikam_config.h"
0022 
0023 Q_LOGGING_CATEGORY(DIGIKAM_GENERAL_LOG,                 "digikam.general",                  QtInfoMsg)
0024 Q_LOGGING_CATEGORY(DIGIKAM_WIDGETS_LOG,                 "digikam.widgets",                  QtInfoMsg)
0025 Q_LOGGING_CATEGORY(DIGIKAM_IOJOB_LOG,                   "digikam.iojob",                    QtInfoMsg)
0026 Q_LOGGING_CATEGORY(DIGIKAM_SHOWFOTO_LOG,                "digikam.showfoto",                 QtInfoMsg)
0027 Q_LOGGING_CATEGORY(DIGIKAM_WEBSERVICES_LOG,             "digikam.webservices",              QtInfoMsg)
0028 Q_LOGGING_CATEGORY(DIGIKAM_DATABASESERVER_LOG,          "digikam.databaseserver",           QtInfoMsg)
0029 Q_LOGGING_CATEGORY(DIGIKAM_IMPORTUI_LOG,                "digikam.import",                   QtInfoMsg)
0030 Q_LOGGING_CATEGORY(DIGIKAM_METAENGINE_LOG,              "digikam.metaengine",               QtInfoMsg)
0031 Q_LOGGING_CATEGORY(DIGIKAM_RAWENGINE_LOG,               "digikam.rawengine",                QtInfoMsg)
0032 Q_LOGGING_CATEGORY(DIGIKAM_FACESENGINE_LOG,             "digikam.facesengine",              QtInfoMsg)
0033 Q_LOGGING_CATEGORY(DIGIKAM_AUTOTAGSENGINE_LOG,          "digikam.autotagsengine",           QtInfoMsg)
0034 Q_LOGGING_CATEGORY(DIGIKAM_GEOIFACE_LOG,                "digikam.geoiface",                 QtInfoMsg)
0035 Q_LOGGING_CATEGORY(DIGIKAM_MARBLE_LOG,                  "digikam.marble",                   QtInfoMsg)
0036 
0037 Q_LOGGING_CATEGORY(DIGIKAM_TESTS_LOG,                   "digikam.tests",                    QtInfoMsg)
0038 
0039 Q_LOGGING_CATEGORY(DIGIKAM_DPLUGIN_GENERIC_LOG,         "digikam.dplugin.generic",          QtInfoMsg)
0040 Q_LOGGING_CATEGORY(DIGIKAM_DPLUGIN_EDITOR_LOG,          "digikam.dplugin.editor",           QtInfoMsg)
0041 Q_LOGGING_CATEGORY(DIGIKAM_DPLUGIN_BQM_LOG,             "digikam.dplugin.bqm",              QtInfoMsg)
0042 
0043 Q_LOGGING_CATEGORY(DIGIKAM_DATABASE_LOG,                "digikam.database",                 QtInfoMsg)
0044 Q_LOGGING_CATEGORY(DIGIKAM_DBENGINE_LOG,                "digikam.dbengine",                 QtInfoMsg)
0045 Q_LOGGING_CATEGORY(DIGIKAM_DBJOB_LOG,                   "digikam.dbjob",                    QtInfoMsg)
0046 Q_LOGGING_CATEGORY(DIGIKAM_COREDB_LOG,                  "digikam.coredb",                   QtInfoMsg)
0047 Q_LOGGING_CATEGORY(DIGIKAM_FACEDB_LOG,                  "digikam.facedb",                   QtInfoMsg)
0048 Q_LOGGING_CATEGORY(DIGIKAM_THUMBSDB_LOG,                "digikam.thumbsdb",                 QtInfoMsg)
0049 Q_LOGGING_CATEGORY(DIGIKAM_SIMILARITYDB_LOG,            "digikam.similaritydb",             QtInfoMsg)
0050 
0051 // NOTE: per default only warnings and more severe messages are logged for other than general category
0052 
0053 Q_LOGGING_CATEGORY(DIGIKAM_DIMG_LOG,                    "digikam.dimg",                     QtInfoMsg)
0054 Q_LOGGING_CATEGORY(DIGIKAM_DIMG_LOG_JPEG,               "digikam.dimg.jpeg",                QtWarningMsg)
0055 Q_LOGGING_CATEGORY(DIGIKAM_DIMG_LOG_JP2K,               "digikam.dimg.jp2k",                QtWarningMsg)
0056 Q_LOGGING_CATEGORY(DIGIKAM_DIMG_LOG_PGF,                "digikam.dimg.pgf",                 QtWarningMsg)
0057 Q_LOGGING_CATEGORY(DIGIKAM_DIMG_LOG_PNG,                "digikam.dimg.png",                 QtWarningMsg)
0058 Q_LOGGING_CATEGORY(DIGIKAM_DIMG_LOG_PPM,                "digikam.dimg.ppm",                 QtWarningMsg)
0059 Q_LOGGING_CATEGORY(DIGIKAM_DIMG_LOG_TIFF,               "digikam.dimg.tiff",                QtWarningMsg)
0060 Q_LOGGING_CATEGORY(DIGIKAM_DIMG_LOG_RAW,                "digikam.dimg.raw",                 QtWarningMsg)
0061 Q_LOGGING_CATEGORY(DIGIKAM_DIMG_LOG_QIMAGE,             "digikam.dimg.qimage",              QtWarningMsg)
0062 Q_LOGGING_CATEGORY(DIGIKAM_DIMG_LOG_HEIF,               "digikam.dimg.heif",                QtWarningMsg)
0063 Q_LOGGING_CATEGORY(DIGIKAM_DIMG_LOG_MAGICK,             "digikam.dimg.magick",              QtWarningMsg)
0064 
0065 Q_LOGGING_CATEGORY(DIGIKAM_MEDIASRV_LOG,                "digikam.mediaserver",              QtInfoMsg)
0066 Q_LOGGING_CATEGORY(DIGIKAM_MEDIASRV_LOG_INFO,           "digikam.mediaserver.info",         QtInfoMsg)
0067 Q_LOGGING_CATEGORY(DIGIKAM_MEDIASRV_LOG_DEBUG,          "digikam.mediaserver.debug",        QtInfoMsg)
0068 Q_LOGGING_CATEGORY(DIGIKAM_MEDIASRV_LOG_WARN,           "digikam.mediaserver.warn",         QtWarningMsg)
0069 Q_LOGGING_CATEGORY(DIGIKAM_MEDIASRV_LOG_CRITICAL,       "digikam.mediaserver.critical",     QtWarningMsg)
0070 Q_LOGGING_CATEGORY(DIGIKAM_MEDIASRV_LOG_FATAL,          "digikam.mediaserver.fatal",        QtCriticalMsg)
0071 
0072 void digikamSetDebugFilterRules(bool on)
0073 {
0074     if (on)
0075     {
0076         QLoggingCategory::setFilterRules(QLatin1String("digikam.*=true\n"
0077                                                        "digikam.dimg.jpeg=false\n"
0078                                                        "digikam.marble=false"));        // to much verbose at the console
0079     }
0080 }