#ifndef LOGGING_HPP
#define LOGGING_HPP

#include "open_engine/ref_scope.hpp"

#include <spdlog/logger.h>
#include <spdlog/spdlog.h>
#include <string>



namespace OpenEngine {
    spdlog::level::level_enum stringToLogLevel(std::string level_str);
    int setupMultisinkLogger(const std::string &file_path);

    class Logger
    {
        public:
            static void Init();

            inline static Ref<spdlog::logger>& GetCoreLogger() { return core_logger; };
            inline static Ref<spdlog::logger>& GetClientLogger() { return client_logger; };

        private:
            static Ref<spdlog::logger> core_logger;
            static Ref<spdlog::logger> client_logger;
    };
}

#define OE_CORE_TRACE(...) ::OpenEngine::Logger::GetCoreLogger()->trace(__VA_ARGS__)
#define OE_CORE_DEBUG(...) ::OpenEngine::Logger::GetCoreLogger()->debug(__VA_ARGS__)
#define OE_CORE_INFO(...) ::OpenEngine::Logger::GetCoreLogger()->info(__VA_ARGS__)
#define OE_CORE_WARN(...) ::OpenEngine::Logger::GetCoreLogger()->warn(__VA_ARGS__)
#define OE_CORE_ERROR(...) ::OpenEngine::Logger::GetCoreLogger()->error(__VA_ARGS__)
#define OE_CORE_CRITICAL(...) ::OpenEngine::Logger::GetCoreLogger()->critical(__VA_ARGS__)

#define OE_TRACE(...) ::OpenEngine::Logger::GetClientLogger()->trace(__VA_ARGS__)
#define OE_DEBUG(...) ::OpenEngine::Logger::GetClientLogger()->debug(__VA_ARGS__)
#define OE_INFO(...) ::OpenEngine::Logger::GetClientLogger()->info(__VA_ARGS__)
#define OE_WARN(...) ::OpenEngine::Logger::GetClientLogger()->warn(__VA_ARGS__)
#define OE_ERROR(...) ::OpenEngine::Logger::GetClientLogger()->error(__VA_ARGS__)
#define OE_CRITICAL(...) ::OpenEngine::Logger::GetClientLogger()->critical(__VA_ARGS__)

#endif // LOGGING_HPP
