diff options
Diffstat (limited to 'src/logger.h')
-rw-r--r-- | src/logger.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/logger.h b/src/logger.h index db9bb49..b1a1d99 100644 --- a/src/logger.h +++ b/src/logger.h | |||
@@ -1,8 +1,29 @@ | |||
1 | #ifndef LOGGER_H_6E7B9594 | 1 | #ifndef LOGGER_H_6E7B9594 |
2 | #define LOGGER_H_6E7B9594 | 2 | #define LOGGER_H_6E7B9594 |
3 | 3 | ||
4 | #include <string> | 4 | #include <wx/wxprec.h> |
5 | 5 | ||
6 | void TrackerLog(const std::string& text); | 6 | #ifndef WX_PRECOMP |
7 | #include <wx/wx.h> | ||
8 | #endif | ||
9 | |||
10 | #include <fstream> | ||
11 | #include <mutex> | ||
12 | |||
13 | class Logger : public wxLog { | ||
14 | public: | ||
15 | Logger(); | ||
16 | |||
17 | void Flush() override; | ||
18 | |||
19 | ~Logger(); | ||
20 | |||
21 | protected: | ||
22 | void DoLogText(const wxString& msg) override; | ||
23 | |||
24 | private: | ||
25 | std::ofstream logfile_; | ||
26 | std::mutex file_mutex_; | ||
27 | }; | ||
7 | 28 | ||
8 | #endif /* end of include guard: LOGGER_H_6E7B9594 */ | 29 | #endif /* end of include guard: LOGGER_H_6E7B9594 */ |