diff options
Diffstat (limited to 'utils/rbutilqt/logger/include/AbstractAppender.h')
-rw-r--r-- | utils/rbutilqt/logger/include/AbstractAppender.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/utils/rbutilqt/logger/include/AbstractAppender.h b/utils/rbutilqt/logger/include/AbstractAppender.h new file mode 100644 index 0000000000..e029b045aa --- /dev/null +++ b/utils/rbutilqt/logger/include/AbstractAppender.h | |||
@@ -0,0 +1,49 @@ | |||
1 | /* | ||
2 | Copyright (c) 2010 Boris Moiseev (cyberbobs at gmail dot com) | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU Lesser General Public License version 2.1 | ||
6 | as published by the Free Software Foundation and appearing in the file | ||
7 | LICENSE.LGPL included in the packaging of this file. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU Lesser General Public License for more details. | ||
13 | */ | ||
14 | #ifndef ABSTRACTAPPENDER_H | ||
15 | #define ABSTRACTAPPENDER_H | ||
16 | |||
17 | // Local | ||
18 | #include "CuteLogger_global.h" | ||
19 | #include <Logger.h> | ||
20 | |||
21 | // Qt | ||
22 | #include <QMutex> | ||
23 | |||
24 | |||
25 | class CUTELOGGERSHARED_EXPORT AbstractAppender | ||
26 | { | ||
27 | public: | ||
28 | AbstractAppender(); | ||
29 | virtual ~AbstractAppender(); | ||
30 | |||
31 | Logger::LogLevel detailsLevel() const; | ||
32 | void setDetailsLevel(Logger::LogLevel level); | ||
33 | void setDetailsLevel(const QString& level); | ||
34 | |||
35 | void write(const QDateTime& timeStamp, Logger::LogLevel logLevel, const char* file, int line, const char* function, | ||
36 | const QString& category, const QString& message); | ||
37 | |||
38 | protected: | ||
39 | virtual void append(const QDateTime& timeStamp, Logger::LogLevel logLevel, const char* file, int line, | ||
40 | const char* function, const QString& category, const QString& message) = 0; | ||
41 | |||
42 | private: | ||
43 | QMutex m_writeMutex; | ||
44 | |||
45 | Logger::LogLevel m_detailsLevel; | ||
46 | mutable QMutex m_detailsLevelMutex; | ||
47 | }; | ||
48 | |||
49 | #endif // ABSTRACTAPPENDER_H | ||