diff options
author | Hop311 <Hop3114@gmail.com> | 2023-05-22 17:54:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-22 17:54:15 +0200 |
commit | 08ec6fe5fbf52d814d88c235aac84bb95ad4e322 (patch) | |
tree | 136a221eb5e7c895c8219778b3d206f2ed9e8e7f /src/openvic/utility/Logger.cpp | |
parent | 15e960f93ced8c94a6a45ebb2b44d0705ff7f8f6 (diff) | |
parent | 7874702f30d5855319faf197b10aed31f07f5e27 (diff) |
Merge pull request #5 from OpenVicProject/bmp
BMP palette parser + code style cleanup
Diffstat (limited to 'src/openvic/utility/Logger.cpp')
-rw-r--r-- | src/openvic/utility/Logger.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/openvic/utility/Logger.cpp b/src/openvic/utility/Logger.cpp new file mode 100644 index 0000000..fe97473 --- /dev/null +++ b/src/openvic/utility/Logger.cpp @@ -0,0 +1,18 @@ +#include "Logger.hpp" + +#include <iostream> + +using namespace OpenVic; + +Logger::log_func_t Logger::info_func = [](std::string&& str) { std::cout << str; }; +Logger::log_func_t Logger::error_func = [](std::string&& str) { std::cerr << str; }; + +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; +} |