aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/utility/Logger.cpp
blob: fca08a53225d96d8eb3f7a39109beedeee389030 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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;
}