aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/utility/Logger.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-11-04 19:44:38 +0100
committer hop311 <hop3114@gmail.com>2023-11-07 19:34:51 +0100
commitb5bbeb47febc823517a5baba4eca66f32fb3609c (patch)
tree1a78d296f22d1cd17a84ce824974f9438a197074 /src/openvic-simulation/utility/Logger.cpp
parentc1b7cab254ac14a173477661047ad2492930ff8b (diff)
Cross-platform file lookup (case and separator)
Diffstat (limited to 'src/openvic-simulation/utility/Logger.cpp')
-rw-r--r--src/openvic-simulation/utility/Logger.cpp34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/openvic-simulation/utility/Logger.cpp b/src/openvic-simulation/utility/Logger.cpp
deleted file mode 100644
index 63dfd6c..0000000
--- a/src/openvic-simulation/utility/Logger.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "Logger.hpp"
-
-#include <iostream>
-
-using namespace OpenVic;
-
-void Logger::set_logger_funcs() {
- Logger::set_info_func([](std::string&& str) {
- std::cout << "[INFO] " << str;
- });
- Logger::set_warning_func([](std::string&& str) {
- std::cerr << "[WARNING] " << str;
- });
- Logger::set_error_func([](std::string&& str) {
- std::cerr << "[ERROR] " << str;
- });
-}
-
-char const* Logger::get_filename(char const* filepath, char const* default_path) {
- if (filepath == nullptr) {
- return default_path;
- }
- char const* last_slash = filepath;
- while (*filepath != '\0') {
- if (*filepath == '\\' || *filepath == '/') {
- last_slash = filepath + 1;
- }
- filepath++;
- }
- if (*last_slash == '\0') {
- return default_path;
- }
- return last_slash;
-}