about summary refs log tree commit diff stats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-06-06 15:54:41 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2024-06-06 15:54:41 -0400
commit8ddab49cc13d809ca75dcd7f645661a3d3cb05c4 (patch)
treeba1e5f3237dbb7cdc939c35e193f5e6e46845a77 /src/main.cpp
parentac38dd0a5c394eefc39b7a8cf7b96762f18c8b31 (diff)
parent6f5287b3921c843a6b322ccbdfcbef00a8f16980 (diff)
downloadlingo-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.cpp23
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
13static std::ofstream* logfile;
14
10class TrackerApp : public wxApp { 15class 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
21wxIMPLEMENT_APP(TrackerApp); 44wxIMPLEMENT_APP(TrackerApp);