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  {
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
static void init(Level lvl, const QString &path)
Definition: logger.cpp:188
The Logger class allows to control a logging that is performed within the library allowed the develop...
Definition: logger.h:55