-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlogger.h
44 lines (37 loc) · 1.11 KB
/
logger.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/***************************************************************************
**
** Copyright (C) 2012 Jolla Ltd.
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/
#ifndef LOGGER_H
#define LOGGER_H
#include <QFile>
#include <QTextStream>
#include <MGConfItem>
//! \internal
class Logger : public QObject
{
Q_OBJECT
public:
Logger(const QString &logPath = QString(), const QString &logLevel = QString());
virtual ~Logger();
void log(const QtMsgType type, const QString &msg);
void setLogPath(const QString &logPath);
void setLogLevel(const QString &logLevel);
private slots:
void logPathChanged();
void logLevelChanged();
private:
QFile* m_logfile;
QTextStream m_logstream;
QtMsgType m_outputLevel;
MGConfItem m_gconfLogPath;
MGConfItem m_gconfLogLevel;
};
#endif