| 32 | } |
| 33 | |
| 34 | std::filesystem::path Log::GetPath(const std::optional<std::filesystem::path> &storageFolder) |
| 35 | { |
| 36 | std::filesystem::path path; |
| 37 | if (storageFolder) |
| 38 | { |
| 39 | path = *storageFolder / L"TempState"; |
| 40 | } |
| 41 | else |
| 42 | { |
| 43 | std::error_code code; |
| 44 | path = std::filesystem::temp_directory_path(code); |
| 45 | if (!code) |
| 46 | { |
| 47 | path /= APP_NAME; |
| 48 | } |
| 49 | else |
| 50 | { |
| 51 | StdErrorCodeHandle(code, spdlog::level::err, L"Failed to get log file path. Logs won't be available during this session"); |
| 52 | |
| 53 | return { }; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | path /= std::format(L"{}.log", GetProcessCreationTime()); |
| 58 | return path; |
| 59 | } |
| 60 | |
| 61 | void Log::LogErrorHandler(const std::string &message) |
| 62 | { |
nothing calls this directly
no outgoing calls
no test coverage detected