diff options
Diffstat (limited to 'utils/rbutilqt/logger/src/OutputDebugAppender.cpp')
-rw-r--r-- | utils/rbutilqt/logger/src/OutputDebugAppender.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/utils/rbutilqt/logger/src/OutputDebugAppender.cpp b/utils/rbutilqt/logger/src/OutputDebugAppender.cpp new file mode 100644 index 0000000000..44d640512f --- /dev/null +++ b/utils/rbutilqt/logger/src/OutputDebugAppender.cpp | |||
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | Copyright (c) 2010 Karl-Heinz Reichel (khreichel at googlemail 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 "OutputDebugAppender.h" | ||
16 | |||
17 | // STL | ||
18 | #include <windows.h> | ||
19 | |||
20 | |||
21 | /** | ||
22 | * \class OutputDebugAppender | ||
23 | * | ||
24 | * \brief Appender that writes the log records to the Microsoft Debug Log | ||
25 | */ | ||
26 | |||
27 | |||
28 | //! Writes the log record to the windows debug log. | ||
29 | /** | ||
30 | * \sa AbstractStringAppender::format() | ||
31 | */ | ||
32 | void OutputDebugAppender::append(const QDateTime& timeStamp, | ||
33 | Logger::LogLevel logLevel, | ||
34 | const char* file, | ||
35 | int line, | ||
36 | const char* function, | ||
37 | const QString& category, | ||
38 | const QString& message) | ||
39 | { | ||
40 | QString s = formattedString(timeStamp, logLevel, file, line, function, category, message); | ||
41 | OutputDebugStringW((LPCWSTR) s.utf16()); | ||
42 | } | ||
43 | |||