diff options
| author | Stefan Boberg <[email protected]> | 2023-05-02 10:01:47 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-02 10:01:47 +0200 |
| commit | 075d17f8ada47e990fe94606c3d21df409223465 (patch) | |
| tree | e50549b766a2f3c354798a54ff73404217b4c9af /zencore/logging.cpp | |
| parent | fix: bundle shouldn't append content zip to zen (diff) | |
| download | zen-075d17f8ada47e990fe94606c3d21df409223465.tar.xz zen-075d17f8ada47e990fe94606c3d21df409223465.zip | |
moved source directories into `/src` (#264)
* moved source directories into `/src`
* updated bundle.lua for new `src` path
* moved some docs, icon
* removed old test trees
Diffstat (limited to 'zencore/logging.cpp')
| -rw-r--r-- | zencore/logging.cpp | 85 |
1 files changed, 0 insertions, 85 deletions
diff --git a/zencore/logging.cpp b/zencore/logging.cpp deleted file mode 100644 index a6423e2dc..000000000 --- a/zencore/logging.cpp +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright Epic Games, Inc. All Rights Reserved. - -#include "zencore/logging.h" - -#include <spdlog/sinks/stdout_color_sinks.h> - -namespace zen { - -// We shadow the underlying spdlog default logger, in order to avoid a bunch of overhead -spdlog::logger* TheDefaultLogger; - -} // namespace zen - -namespace zen::logging { - -spdlog::logger& -Default() -{ - return *TheDefaultLogger; -} - -void -SetDefault(std::shared_ptr<spdlog::logger> NewDefaultLogger) -{ - spdlog::set_default_logger(NewDefaultLogger); - TheDefaultLogger = spdlog::default_logger_raw(); -} - -spdlog::logger& -Get(std::string_view Name) -{ - std::shared_ptr<spdlog::logger> Logger = spdlog::get(std::string(Name)); - - if (!Logger) - { - Logger = Default().clone(std::string(Name)); - spdlog::register_logger(Logger); - } - - return *Logger; -} - -std::once_flag ConsoleInitFlag; -std::shared_ptr<spdlog::logger> ConLogger; - -spdlog::logger& -ConsoleLog() -{ - std::call_once(ConsoleInitFlag, [&] { - ConLogger = spdlog::stdout_color_mt("console"); - - ConLogger->set_pattern("%v"); - }); - - return *ConLogger; -} - -std::shared_ptr<spdlog::logger> TheErrorLogger; - -spdlog::logger* -ErrorLog() -{ - return TheErrorLogger.get(); -} - -void -SetErrorLog(std::shared_ptr<spdlog::logger>&& NewErrorLogger) -{ - TheErrorLogger = std::move(NewErrorLogger); -} - -void -InitializeLogging() -{ - TheDefaultLogger = spdlog::default_logger_raw(); -} - -void -ShutdownLogging() -{ - spdlog::drop_all(); - spdlog::shutdown(); -} - -} // namespace zen::logging |