/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ #pragma once #define SPDLOG_DEBUG_ON #define SPDLOG_TRACE_ON #include namespace OpenVulkano { class Logger { //TODO add custom sink for in game/engine console static std::vector SINKS; static std::vector> LOGGERS; public: typedef std::shared_ptr Ptr; static Ptr WINDOW; static Ptr MANAGER; static Ptr RENDER; static Ptr PHYSIC; static Ptr AUDIO; static Ptr DATA; static Ptr SCENE; static Ptr INPUT; static Ptr FILESYS; static Ptr AR; static Ptr PERF; static Ptr APP; static void SetupLogger(std::string logFolder = "", const std::string& logFile = "openVulkano.log", bool handleSignals = false); /** * \brief Creates a new custom logger that writes to the main log file. * \param name The name of the logger * \param reg If set to true the logger can be accessed again with Logger::GetLogger(name) * \return The created logger, if reg = true and a logger with the given name already exists this function will return the old logger. */ static Ptr CreateLogger(const std::string& name, bool reg = true); static Ptr GetLogger(const std::string& name); static void RegisterSink(const spdlog::sink_ptr& newSink); }; }