about summary refs log tree commit diff stats
path: root/src/logger.cpp
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-06-09 22:43:20 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2024-06-09 22:43:20 -0400
commit475b7a38f66071ad5713f6f00a49c4e1399e0613 (patch)
tree4dcb76d5bb9e1dbabe19dcbd0cc9676c31f715e6 /src/logger.cpp
parent829bb6ba7fdbef5c4e6fb9e4eabc0c2f962325ae (diff)
parent14d075e02007aeb53dbadd6c629564ee467cd7b2 (diff)
downloadlingo-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/logger.cpp')
-rw-r--r--src/logger.cpp32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/logger.cpp b/src/logger.cpp deleted file mode 100644 index 4b722c8..0000000 --- a/src/logger.cpp +++ /dev/null
@@ -1,32 +0,0 @@
1#include "logger.h"
2
3#include <chrono>
4#include <fstream>
5#include <mutex>
6
7#include "global.h"
8
9namespace {
10
11class Logger {
12 public:
13 Logger() : logfile_(GetAbsolutePath("debug.log")) {}
14
15 void LogLine(const std::string& text) {
16 std::lock_guard guard(file_mutex_);
17 logfile_ << "[" << std::chrono::system_clock::now() << "] " << text
18 << std::endl;
19 logfile_.flush();
20 }
21
22 private:
23 std::ofstream logfile_;
24 std::mutex file_mutex_;
25};
26
27} // namespace
28
29void TrackerLog(const std::string& text) {
30 static Logger* instance = new Logger();
31 instance->LogLine(text);
32}