diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-05-14 12:53:59 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-05-14 12:53:59 -0400 |
commit | bee4194f9e12c9d2210a5ecba7249bdfe3f3deda (patch) | |
tree | 1212b2f05cea09e4fbf8f1a3c57418fb3e92fc36 /src/logger.h | |
parent | dff1d7382f2af91e50561bfdb9eb83773ac7c010 (diff) | |
download | lingo-ap-tracker-bee4194f9e12c9d2210a5ecba7249bdfe3f3deda.tar.gz lingo-ap-tracker-bee4194f9e12c9d2210a5ecba7249bdfe3f3deda.tar.bz2 lingo-ap-tracker-bee4194f9e12c9d2210a5ecba7249bdfe3f3deda.zip |
Switch to wx logging
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 */ |