Ubuntu Download Manager: /build/ubuntu-download-manager-git/src/ubuntu-download-manager/src/downloads/client/ubuntu/download_manager/logging/logger.h Source File

Ubuntu Download Manager 1.2.0 A session-wide downloading service |

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 UBUNTU_DOWNLOADMANAGER_CLIENT_LOGGER_H
20 #define UBUNTU_DOWNLOADMANAGER_CLIENT_LOGGER_H
21
22 #include <QMap>
23 #include <QMutex>
24 #include <QString>
25 #include <QStringList>
26 #include <QVariant>
27
28
29 namespace Ubuntu {
30
31 namespace DownloadManager {
32
33 class DownloadImpl;
34 class DownloadPCW;
35 class ManagerImpl;
36 class DownloadManagerPCW;
37 class DownloadsListManagerPCW;
38 class GroupManagerPCW;
39 class MetadataDownloadsListManagerPCW;
40 class DownloadStruct;
41
42 namespace Logging {
43
44 class LoggerPrivate;
45
55 class Logger {
56 friend class Ubuntu::DownloadManager::DownloadImpl;
57 friend class Ubuntu::DownloadManager::DownloadPCW;
58 friend class Ubuntu::DownloadManager::ManagerImpl;
59 friend class Ubuntu::DownloadManager::DownloadManagerPCW;
60 friend class Ubuntu::DownloadManager::DownloadsListManagerPCW;
61 friend class Ubuntu::DownloadManager::GroupManagerPCW;
62 friend class Ubuntu::DownloadManager::MetadataDownloadsListManagerPCW;
63
64 public:
66 enum Level
67 {
68 Debug,
69 Normal,
70 Notification,
71 Warning,
72 Error,
73 Critical
74 };
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 } // Ubuntu
106
107 #endif
Ubuntu
Definition: download.h:26
Ubuntu::DownloadManager::Logging::Logger::Warning
@ Warning
Definition: logger.h:71
Ubuntu::DownloadManager::Logging::Logger::Critical
@ Critical
Definition: logger.h:73
Ubuntu::DownloadManager::Logging::Logger::Error
@ Error
Definition: logger.h:72
Ubuntu::DownloadManager::Logging::Logger
The Logger class allows to control a logging that is performed within the library allowed the develop...
Definition: logger.h:55
Ubuntu::DownloadManager::Logging::Logger::Debug
@ Debug
Definition: logger.h:68
Ubuntu::DownloadManager::Logging::Logger::Normal
@ Normal
Definition: logger.h:69
Ubuntu::DownloadManager::Logging::Logger::Level
Level
Definition: logger.h:67
Ubuntu::DownloadManager::Logging::Logger::Notification
@ Notification
Definition: logger.h:70
Ubuntu::DownloadManager::Logging::Logger::init
static void init(Level lvl, const QString &path)
Definition: logger.cpp:188