diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2024-06-06 15:54:41 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2024-06-06 15:54:41 -0400 |
commit | 8ddab49cc13d809ca75dcd7f645661a3d3cb05c4 (patch) | |
tree | ba1e5f3237dbb7cdc939c35e193f5e6e46845a77 /src/main.cpp | |
parent | ac38dd0a5c394eefc39b7a8cf7b96762f18c8b31 (diff) | |
parent | 6f5287b3921c843a6b322ccbdfcbef00a8f16980 (diff) | |
download | lingo-ap-tracker-8ddab49cc13d809ca75dcd7f645661a3d3cb05c4.tar.gz lingo-ap-tracker-8ddab49cc13d809ca75dcd7f645661a3d3cb05c4.tar.bz2 lingo-ap-tracker-8ddab49cc13d809ca75dcd7f645661a3d3cb05c4.zip |
Merge branch 'subway'
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..abe6626 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 | |||
21 | #ifndef NDEBUG | ||
22 | wxLog::SetVerbose(true); | ||
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); |