-------------------------------------------------------------------------
| 46 | |
| 47 | //------------------------------------------------------------------------- |
| 48 | void InitConsoleAndFileLog(const std::filesystem::path& logPath) |
| 49 | { |
| 50 | boost::log::add_common_attributes(); |
| 51 | |
| 52 | auto fileSink = logging::add_file_log(logPath.wstring(), |
| 53 | boost::log::keywords::format = |
| 54 | expr::stream |
| 55 | << "[" << expr::format_date_time< boost::posix_time::ptime >("TimeStamp", "%Y-%m-%d %H:%M:%S") |
| 56 | << "] [" << logging::trivial::severity |
| 57 | << "] " << expr::message); |
| 58 | |
| 59 | auto consoleSink = logging::add_console_log(std::clog, |
| 60 | boost::log::keywords::format = |
| 61 | expr::stream |
| 62 | << "[" << logging::trivial::severity |
| 63 | << "] " << expr::message |
| 64 | ); |
| 65 | |
| 66 | // Set correct endocing for special char |
| 67 | auto loc = boost::locale::generator()("en_US.UTF-8"); |
| 68 | fileSink->imbue(loc); |
| 69 | consoleSink->imbue(loc); |
| 70 | } |
| 71 | |
| 72 | //------------------------------------------------------------------------- |
| 73 | void SetLoggerMinSeverity(boost::log::trivial::severity_level minSeverity) |