Add convenient macros to set up logging for Keymsith

master
Johan Ouwerkerk 2020-04-14 19:39:13 +02:00
parent ecf3476faa
commit b4dada08d8
1 changed files with 19 additions and 0 deletions

19
src/logging_p.h Normal file
View File

@ -0,0 +1,19 @@
/*
* SPDX-License-Identifier: GPL-3.0-or-later
* SPDX-FileCopyrightText: 2020 Johan Ouwerkerk <jm.ouwerkerk@gmail.com>
*/
#ifndef KEYSMITH_LOGGING_PRIVATE_H
#define KEYSMITH_LOGGING_PRIVATE_H
#include <QLoggingCategory>
#define DEFAULT_LOGGER(name, category) \
static const QLoggingCategory &name(void) \
{ \
static QLoggingCategory c(category, QtMsgType::QtInfoMsg); \
return c; \
}
#define KEYSMITH_LOGGER(name, category) DEFAULT_LOGGER(name, "org.kde.keysmith" category)
#endif