diff options
author | Hop311 <Hop3114@gmail.com> | 2023-09-09 23:49:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-09 23:49:54 +0200 |
commit | 6278a35f4704574933464700026d8deb997da5c1 (patch) | |
tree | eb36a9b030b263d825eb93638e64deb0dbd38a78 /src/openvic-simulation/utility/Logger.cpp | |
parent | bec619fc8f554cb075fcef2428f3b6bdb5e88e82 (diff) | |
parent | 3d7fbd9b376811ca0ed226fa78bcc8b6279ba8dc (diff) |
Merge pull request #14 from OpenVicProject/dataloading
Dataloading scaffolding + basic culture and pop history loading
Diffstat (limited to 'src/openvic-simulation/utility/Logger.cpp')
-rw-r--r-- | src/openvic-simulation/utility/Logger.cpp | 22 |
1 files changed, 22 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..fca08a5 --- /dev/null +++ b/src/openvic-simulation/utility/Logger.cpp @@ -0,0 +1,22 @@ +#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::warning_func {}; +Logger::log_queue_t Logger::warning_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; +} |