Buteo Synchronization Framework
Logger.h
1/*
2 * This file is part of buteo-syncfw package
3 *
4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
5 * Copyright (C) 2013 - 2021 Jolla Ltd.
6 *
7 * Contact: Sateesh Kavuri <sateesh.kavuri@nokia.com>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * version 2.1 as published by the Free Software Foundation.
12 *
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 *
23 */
24
25
26#ifndef LOGGER_H
27#define LOGGER_H
28
29#include <QLoggingCategory>
30#include <QElapsedTimer>
31
32namespace Buteo {
33
38{
39public:
45 LogTimer(const QString &categoryName, const QString &func);
46
51 ~LogTimer();
52
53private:
54 QElapsedTimer m_timer;
55 QByteArray m_categoryName;
56 QString m_func;
57 QLoggingCategory m_category;
58};
59
60bool isLoggingEnabled(const QLoggingCategory &loggingCategory);
61
62void configureLegacyLogging();
63
64}
65
66Q_DECLARE_LOGGING_CATEGORY(lcButeoCore)
67Q_DECLARE_LOGGING_CATEGORY(lcButeoMsyncd)
68Q_DECLARE_LOGGING_CATEGORY(lcButeoPlugin)
69Q_DECLARE_LOGGING_CATEGORY(lcButeoTrace)
70
71#endif // LOGGER_H
72
Helper class for timing function execution time.
Definition: Logger.h:38
~LogTimer()
Destructor. Creates an exit message to the log, including function execution time.
Definition: Logger.cpp:42