diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-06-09 22:43:20 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-06-09 22:43:20 -0400 |
commit | 475b7a38f66071ad5713f6f00a49c4e1399e0613 (patch) | |
tree | 4dcb76d5bb9e1dbabe19dcbd0cc9676c31f715e6 /src/main.cpp | |
parent | 829bb6ba7fdbef5c4e6fb9e4eabc0c2f962325ae (diff) | |
parent | 14d075e02007aeb53dbadd6c629564ee467cd7b2 (diff) | |
download | lingo-ap-tracker-475b7a38f66071ad5713f6f00a49c4e1399e0613.tar.gz lingo-ap-tracker-475b7a38f66071ad5713f6f00a49c4e1399e0613.tar.bz2 lingo-ap-tracker-475b7a38f66071ad5713f6f00a49c4e1399e0613.zip |
Merge branch 'main' into panels
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index fe9aceb..b327b25 100644 --- a/src/main.cpp +++ b/src/main.cpp | |||
@@ -4,18 +4,41 @@ | |||
4 | #include <wx/wx.h> | 4 | #include <wx/wx.h> |
5 | #endif | 5 | #endif |
6 | 6 | ||
7 | #include <fstream> | ||
8 | |||
9 | #include "global.h" | ||
7 | #include "tracker_config.h" | 10 | #include "tracker_config.h" |
8 | #include "tracker_frame.h" | 11 | #include "tracker_frame.h" |
9 | 12 | ||
13 | static std::ofstream* logfile; | ||
14 | |||
10 | class TrackerApp : public wxApp { | 15 | class TrackerApp : public wxApp { |
11 | public: | 16 | public: |
12 | virtual bool OnInit() { | 17 | virtual bool OnInit() { |
18 | logfile = new std::ofstream(GetAbsolutePath("debug.log")); | ||
19 | wxLog::SetActiveTarget(new wxLogStream(logfile)); | ||
20 | wxLog::SetVerbose(true); | ||
21 | |||
22 | #ifndef NDEBUG | ||
23 | wxLog::SetActiveTarget(new wxLogWindow(nullptr, "Debug Log")); | ||
24 | #endif | ||
25 | |||
13 | GetTrackerConfig().Load(); | 26 | GetTrackerConfig().Load(); |
14 | 27 | ||
15 | TrackerFrame *frame = new TrackerFrame(); | 28 | TrackerFrame *frame = new TrackerFrame(); |
16 | frame->Show(true); | 29 | frame->Show(true); |
17 | return true; | 30 | return true; |
18 | } | 31 | } |
32 | |||
33 | bool OnExceptionInMainLoop() override { | ||
34 | try { | ||
35 | throw; | ||
36 | } catch (const std::exception& ex) { | ||
37 | wxLogError(ex.what()); | ||
38 | } | ||
39 | |||
40 | return false; | ||
41 | } | ||
19 | }; | 42 | }; |
20 | 43 | ||
21 | wxIMPLEMENT_APP(TrackerApp); | 44 | wxIMPLEMENT_APP(TrackerApp); |