aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/utility/Logger.cpp
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-09-08 18:12:22 +0200
committer Hop311 <hop3114@gmail.com>2023-09-08 18:12:22 +0200
commit7772f8871348b7b52cb0a478bb76df68d8799a07 (patch)
treefd8c4626b2cee69a9fe9250365af6b18eea63c70 /src/openvic-simulation/utility/Logger.cpp
parent7f9a9a8241ba81be9213e6606b8be4a48f1cbaab (diff)
More refactoring and duplicate code removal
Diffstat (limited to 'src/openvic-simulation/utility/Logger.cpp')
-rw-r--r--src/openvic-simulation/utility/Logger.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/openvic-simulation/utility/Logger.cpp b/src/openvic-simulation/utility/Logger.cpp
new file mode 100644
index 0000000..bf9a67c
--- /dev/null
+++ b/src/openvic-simulation/utility/Logger.cpp
@@ -0,0 +1,20 @@
+#include "Logger.hpp"
+
+#include <iostream>
+
+using namespace OpenVic;
+
+Logger::log_func_t Logger::info_func {};
+Logger::log_queue_t Logger::info_queue {};
+Logger::log_func_t Logger::error_func {};
+Logger::log_queue_t Logger::error_queue {};
+
+char const* Logger::get_filename(char const* filepath) {
+ if (filepath == nullptr) return nullptr;
+ char const* last_slash = filepath;
+ while (*filepath != '\0') {
+ if (*filepath == '\\' || *filepath == '/') last_slash = filepath + 1;
+ filepath++;
+ }
+ return last_slash;
+}