diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2013-11-03 11:08:18 +0100 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2013-11-04 23:32:52 +0100 |
commit | 4d2ce949b3b41f8bf0af446fa20205ddd229e579 (patch) | |
tree | 01fa19471d9831b296bea5d7049f765e38b30bbb /rbutil/rbutilqt/logger/ConsoleAppender.h | |
parent | 335ec75d60bba82f23fc47b20f9390e0cba9c9c5 (diff) | |
download | rockbox-4d2ce949b3b41f8bf0af446fa20205ddd229e579.tar.gz rockbox-4d2ce949b3b41f8bf0af446fa20205ddd229e579.zip |
Use cutelogger for Rockbox Utility internal trace.
Change tracing from qDebug() to use cutelogger, which is available under the
LGPL2.1. This allows to automatically add filename and line number to the log,
and also provides multiple log levels.
Change-Id: I5dbdaf902ba54ea99f07ae10a07467c52fdac910
Diffstat (limited to 'rbutil/rbutilqt/logger/ConsoleAppender.h')
-rw-r--r-- | rbutil/rbutilqt/logger/ConsoleAppender.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/rbutil/rbutilqt/logger/ConsoleAppender.h b/rbutil/rbutilqt/logger/ConsoleAppender.h new file mode 100644 index 0000000000..fa685b5e82 --- /dev/null +++ b/rbutil/rbutilqt/logger/ConsoleAppender.h | |||
@@ -0,0 +1,32 @@ | |||
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 CONSOLEAPPENDER_H | ||
15 | #define CONSOLEAPPENDER_H | ||
16 | |||
17 | #include "CuteLogger_global.h" | ||
18 | #include <AbstractStringAppender.h> | ||
19 | |||
20 | //! ConsoleAppender is the simple appender that writes the log records to the std::cerr output stream. | ||
21 | class CUTELOGGERSHARED_EXPORT ConsoleAppender : public AbstractStringAppender | ||
22 | { | ||
23 | protected: | ||
24 | //! Writes the log record to the std::cerr stream. | ||
25 | /** | ||
26 | * \sa AbstractStringAppender::format() | ||
27 | */ | ||
28 | virtual void append(const QDateTime& timeStamp, Logger::LogLevel logLevel, const char* file, int line, | ||
29 | const char* function, const QString& message); | ||
30 | }; | ||
31 | |||
32 | #endif // CONSOLEAPPENDER_H | ||