Loading...
Searching...
No Matches
logger.h
Go to the documentation of this file.
/*
* Copyright 2014 Canonical Ltd.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of version 3 of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef LOMIRI_DOWNLOADMANAGER_CLIENT_LOGGER_H
#define LOMIRI_DOWNLOADMANAGER_CLIENT_LOGGER_H
#include <QMap>
#include <QMutex>
#include <QString>
#include <QStringList>
#include <QVariant>
namespace Lomiri {
namespace DownloadManager {
class DownloadImpl;
class DownloadPCW;
class ManagerImpl;
class DownloadManagerPCW;
class DownloadsListManagerPCW;
class GroupManagerPCW;
class MetadataDownloadsListManagerPCW;
class DownloadStruct;
namespace Logging {
class LoggerPrivate;
class Logger {
friend class Lomiri::DownloadManager::DownloadImpl;
friend class Lomiri::DownloadManager::DownloadPCW;
friend class Lomiri::DownloadManager::ManagerImpl;
friend class Lomiri::DownloadManager::DownloadManagerPCW;
friend class Lomiri::DownloadManager::DownloadsListManagerPCW;
friend class Lomiri::DownloadManager::GroupManagerPCW;
friend class Lomiri::DownloadManager::MetadataDownloadsListManagerPCW;
public:
enum Level
{
Debug,
Normal,
Notification,
Warning,
Error,
Critical
};
static void init(Level lvl, const QString& path);
protected:
static void log(Level lvl, const QString& msg);
static void log(Level lvl, const QStringList& msg);
static void log(Level lvl, const QString& msg, QMap<QString, QString> map);
static void log(Level lvl, const QString& msg, QMap<QString, QVariant> map);
static void log(Level lvl, const QString& msg, DownloadStruct downStruct);
private:
static QMutex _mutex;
static LoggerPrivate* _private;
};
} // Logging
} // DownloadManager
} // Lomiri
#endif
Lomiri::DownloadManager::Logging::Logger
The Logger class allows to control a logging that is performed within the library allowed the develop...
Definition logger.h:55
Lomiri::DownloadManager::Logging::Logger::Level
Level
Definition logger.h:67
Lomiri::DownloadManager::Logging::Logger::Debug
@ Debug
Definition logger.h:68
Lomiri::DownloadManager::Logging::Logger::Normal
@ Normal
Definition logger.h:69
Lomiri::DownloadManager::Logging::Logger::Critical
@ Critical
Definition logger.h:73
Lomiri::DownloadManager::Logging::Logger::Notification
@ Notification
Definition logger.h:70
Lomiri::DownloadManager::Logging::Logger::Error
@ Error
Definition logger.h:72
Lomiri::DownloadManager::Logging::Logger::Warning
@ Warning
Definition logger.h:71
Lomiri::DownloadManager::Logging::Logger::init
static void init(Level lvl, const QString &path)
Definition logger.cpp:188
Lomiri::DownloadManager::Logging
Definition logger.cpp:77
Lomiri::DownloadManager
Definition download.h:28
Lomiri
Definition download.h:26