Use shared SVG renderers.
[sloppygui.git] / src / guilogger.h
blob2ff705eacf3ad8f78176c660fa2447da9fe5cdfd
1 /*
2 This file is part of SloppyGUI.
4 SloppyGUI is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 SloppyGUI 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 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with SloppyGUI. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef GUILOGGER_H
19 #define GUILOGGER_H
21 #include "loggerbase.h"
23 class QTextEdit;
25 /**
26 * GuiLogger class provides logging output to QTextEdit.
28 * Like in the LogManager's case, you should not use this class directly but
29 * add GuiLogger to the list of loggers (LogManager::addLogger) and use Qt's
30 * own debugging functions qDebug(), qWarning(), qCritical() and qFatal() to
31 * do the logging. See Qt's documentation how to use these functions.
33 * In addition to the log message GuiLogger logs the time when the message
34 * was added. This functionality is not configurable.
36 * The message's type does not affect the output; all messages are handled
37 * similarly.
39 class GuiLogger : public LoggerBase
41 public:
42 /**
43 * Creates a new GuiLogger object.
44 * @param logWidget The widget which will receive the log messages.
46 GuiLogger(QTextEdit* logWidget);
48 /**
49 * Appends a new log messages to the QTextEdit widget.
50 * Message's type does not affect the output.
51 * The current time is added before the log message.
52 * @param type Message's type.
53 * @param message The message.
55 void log(QtMsgType type, const char *message);
57 private:
58 QTextEdit* m_widget;
61 #endif // GUILOGGER_H