diff options
Diffstat (limited to 'src/zencore')
| -rw-r--r-- | src/zencore/include/zencore/fmtutils.h | 11 | ||||
| -rw-r--r-- | src/zencore/logging.cpp | 4 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/zencore/include/zencore/fmtutils.h b/src/zencore/include/zencore/fmtutils.h index a927df866..3d29625be 100644 --- a/src/zencore/include/zencore/fmtutils.h +++ b/src/zencore/include/zencore/fmtutils.h @@ -58,9 +58,18 @@ struct fmt::formatter<std::filesystem::path> : formatter<string_view> template<typename FormatContext> auto format(const std::filesystem::path& Path, FormatContext& ctx) { + using namespace std::literals; + zen::ExtendableStringBuilder<128> String; String << Path.u8string(); - return fmt::formatter<string_view>::format(String.ToView(), ctx); + std::string_view PathView = String.ToView(); + + if (PathView.starts_with("\\\\?\\"sv)) + { + PathView.remove_prefix(4); + } + + return fmt::formatter<string_view>::format(PathView, ctx); } }; diff --git a/src/zencore/logging.cpp b/src/zencore/logging.cpp index ff37af368..c366df812 100644 --- a/src/zencore/logging.cpp +++ b/src/zencore/logging.cpp @@ -20,12 +20,14 @@ namespace zen::logging { spdlog::logger& Default() { + ZEN_ASSERT(TheDefaultLogger); return *TheDefaultLogger; } void SetDefault(std::shared_ptr<spdlog::logger> NewDefaultLogger) { + ZEN_ASSERT(NewDefaultLogger); spdlog::set_default_logger(NewDefaultLogger); TheDefaultLogger = spdlog::default_logger_raw(); } @@ -73,6 +75,7 @@ std::shared_ptr<spdlog::logger> TheErrorLogger; spdlog::logger* ErrorLog() { + // This may return nullptr return TheErrorLogger.get(); } @@ -93,6 +96,7 @@ ShutdownLogging() { spdlog::drop_all(); spdlog::shutdown(); + TheDefaultLogger = nullptr; } bool |