summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/logger/AbstractAppender.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/logger/AbstractAppender.cpp')
-rw-r--r--rbutil/rbutilqt/logger/AbstractAppender.cpp58
1 files changed, 0 insertions, 58 deletions
diff --git a/rbutil/rbutilqt/logger/AbstractAppender.cpp b/rbutil/rbutilqt/logger/AbstractAppender.cpp
deleted file mode 100644
index de86b930d0..0000000000
--- a/rbutil/rbutilqt/logger/AbstractAppender.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
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// Local
15#include "AbstractAppender.h"
16
17// Qt
18#include <QMutexLocker>
19
20
21AbstractAppender::AbstractAppender()
22 : m_detailsLevel(Logger::Debug)
23{}
24
25
26AbstractAppender::~AbstractAppender()
27{}
28
29
30Logger::LogLevel AbstractAppender::detailsLevel() const
31{
32 QMutexLocker locker(&m_detailsLevelMutex);
33 return m_detailsLevel;
34}
35
36
37void AbstractAppender::setDetailsLevel(Logger::LogLevel level)
38{
39 QMutexLocker locker(&m_detailsLevelMutex);
40 m_detailsLevel = level;
41}
42
43
44void AbstractAppender::setDetailsLevel(const QString& level)
45{
46 setDetailsLevel(Logger::levelFromString(level));
47}
48
49
50void AbstractAppender::write(const QDateTime& timeStamp, Logger::LogLevel logLevel, const char* file, int line,
51 const char* function, const QString& message)
52{
53 if (logLevel >= detailsLevel())
54 {
55 QMutexLocker locker(&m_writeMutex);
56 append(timeStamp, logLevel, file, line, function, message);
57 }
58}