diff options
author | Hop311 <Hop3114@gmail.com> | 2023-10-29 21:14:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-29 21:14:55 +0100 |
commit | 06cc0606156d009026930c785c62434276fbe782 (patch) | |
tree | d37fcb69766ec029ea4e3e2816c419f9d7e05f7c /src/openvic-simulation/utility/Logger.cpp | |
parent | d8ec90f07342876e9331819bd3cc372050f78248 (diff) | |
parent | 1b5e43fa7750cc4025d32f18390593cbce3ba842 (diff) |
Merge pull request #67 from OpenVicProject/format
Formating
Diffstat (limited to 'src/openvic-simulation/utility/Logger.cpp')
-rw-r--r-- | src/openvic-simulation/utility/Logger.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/openvic-simulation/utility/Logger.cpp b/src/openvic-simulation/utility/Logger.cpp index 68c43dd..5e25c98 100644 --- a/src/openvic-simulation/utility/Logger.cpp +++ b/src/openvic-simulation/utility/Logger.cpp @@ -5,18 +5,30 @@ using namespace OpenVic; void Logger::set_logger_funcs() { - Logger::set_info_func([](std::string&& str) { std::cout << str; }); - Logger::set_warning_func([](std::string&& str) { std::cerr << str; }); - Logger::set_error_func([](std::string&& str) { std::cerr << str; }); + Logger::set_info_func([](std::string&& str) { + std::cout << str; + }); + Logger::set_warning_func([](std::string&& str) { + std::cerr << str; + }); + Logger::set_error_func([](std::string&& str) { + std::cerr << str; + }); } char const* Logger::get_filename(char const* filepath, char const* default_path) { - if (filepath == nullptr) return default_path; + if (filepath == nullptr) { + return default_path; + } char const* last_slash = filepath; while (*filepath != '\0') { - if (*filepath == '\\' || *filepath == '/') last_slash = filepath + 1; + if (*filepath == '\\' || *filepath == '/') { + last_slash = filepath + 1; + } filepath++; } - if (*last_slash == '\0') return default_path; + if (*last_slash == '\0') { + return default_path; + } return last_slash; } |