Lomiri Download Manager 0.1.1
A session-wide downloading service
 
Loading...
Searching...
No Matches
logger.h
Go to the documentation of this file.
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of version 3 of the GNU Lesser General Public
6 * License as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the
15 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 * Boston, MA 02110-1301, USA.
17 */
18
19#ifndef LOMIRI_DOWNLOADMANAGER_CLIENT_LOGGER_H
20#define LOMIRI_DOWNLOADMANAGER_CLIENT_LOGGER_H
21
22#include <QMap>
23#include <QMutex>
24#include <QString>
25#include <QStringList>
26#include <QVariant>
27
28
29namespace Lomiri {
30
31namespace DownloadManager {
32
33class DownloadImpl;
34class DownloadPCW;
35class ManagerImpl;
36class DownloadManagerPCW;
37class DownloadsListManagerPCW;
38class GroupManagerPCW;
39class MetadataDownloadsListManagerPCW;
40class DownloadStruct;
41
42namespace Logging {
43
44class LoggerPrivate;
45
55class Logger {
56 friend class Lomiri::DownloadManager::DownloadImpl;
57 friend class Lomiri::DownloadManager::DownloadPCW;
58 friend class Lomiri::DownloadManager::ManagerImpl;
59 friend class Lomiri::DownloadManager::DownloadManagerPCW;
60 friend class Lomiri::DownloadManager::DownloadsListManagerPCW;
61 friend class Lomiri::DownloadManager::GroupManagerPCW;
62 friend class Lomiri::DownloadManager::MetadataDownloadsListManagerPCW;
63
64 public:
75
82 static void init(Level lvl, const QString& path);
83
84 protected:
85
88 static void log(Level lvl, const QString& msg);
89 static void log(Level lvl, const QStringList& msg);
90 static void log(Level lvl, const QString& msg, QMap<QString, QString> map);
91 static void log(Level lvl, const QString& msg, QMap<QString, QVariant> map);
92 static void log(Level lvl, const QString& msg, DownloadStruct downStruct);
96 private:
97 static QMutex _mutex;
98 static LoggerPrivate* _private;
99};
100
101} // Logging
102
103} // DownloadManager
104
105} // Lomiri
106
107#endif
The Logger class allows to control a logging that is performed within the library allowed the develop...
Definition logger.h:55
static void init(Level lvl, const QString &path)
Definition logger.cpp:188