From b4dada08d8f56579f683e45722858f658cbe6348 Mon Sep 17 00:00:00 2001 From: Johan Ouwerkerk Date: Tue, 14 Apr 2020 19:39:13 +0200 Subject: [PATCH] Add convenient macros to set up logging for Keymsith --- src/logging_p.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/logging_p.h diff --git a/src/logging_p.h b/src/logging_p.h new file mode 100644 index 0000000..b24df00 --- /dev/null +++ b/src/logging_p.h @@ -0,0 +1,19 @@ +/* + * SPDX-License-Identifier: GPL-3.0-or-later + * SPDX-FileCopyrightText: 2020 Johan Ouwerkerk + */ +#ifndef KEYSMITH_LOGGING_PRIVATE_H +#define KEYSMITH_LOGGING_PRIVATE_H + +#include + +#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