OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
DevLogger.h
Go to the documentation of this file.
1#ifndef OTDEVLOGGER__H
2#define OTDEVLOGGER__H
3
4#include "OTCore/Logger.h"
5
8#define OT_UISERVICE_DEV_LOGGER_ACTIVE 0
9
10// #################################################################################################################################################################################################################
11
12#if OT_UISERVICE_DEV_LOGGER_ACTIVE==0
13#define OT_UISERVICE_DEV_LOGGER_INIT
14
15#elif OT_UISERVICE_DEV_LOGGER_ACTIVE==1
16#define OT_UISERVICE_DEV_LOGGER_INIT ot::intern::UiDevLogger::initialize()
17
18#pragma message("The UIService DevLogger is used. Do not ship this build")
19
20#include <QtWidgets/qplaintextedit.h>
21#include <QtCore/qthread.h>
22
23class QMainWindow;
24
25namespace ot {
26
27 class SimpleLogViewer : public QPlainTextEdit {
28 Q_OBJECT
29 public:
30 SimpleLogViewer();
31 virtual ~SimpleLogViewer();
32
33 void appendLog(const ot::LogMessage& _message);
34
35 private Q_SLOTS:
36 void slotAppendLog(const ot::LogMessage& _message);
37
38 private:
39 Qt::HANDLE m_creatorThread;
40 };
41
42
43 namespace intern {
44
45 class UiDevLogger : public ot::AbstractLogNotifier {
46 public:
47 static UiDevLogger& instance(void);
48 static void initialize(void);
49
50 virtual void log(const ot::LogMessage& _message) override;
51
52 private:
53 UiDevLogger();
54 virtual ~UiDevLogger();
55
56 QMainWindow* m_window;
57 ot::SimpleLogViewer* m_viewer;
58 };
59
60 }
61}
62
63#endif // OT_UISERVICE_DEV_LOGGER_ACTIVE
64#endif // OTDEVLOGGER__H
OpenTwin Logging system.
Used to receive every log message that is generated.
Definition Logger.h:431
Contains information about the origin and the content of a log message.
Definition Logger.h:345
Definition GraphicsPicker.cpp:29
Definition Connector.h:8
OTOOLKITAPI_EXPORTONLY bool initialize(APIInterface *_interface)
Definition OToolkitAPI.cpp:53