#pragma once


#include "Core.h"
#include "spdlog/spdlog.h"
#include "spdlog/sinks/stdout_color_sinks.h"
#include "spdlog/fmt/ostr.h"

namespace Jenova
{

	class JENOVA_API Log
	{
	public:
		static void Init();
		inline static std::shared_ptr<spdlog::logger>& GetCoreLogger() { return s_CoreLogger; }
		inline static std::shared_ptr<spdlog::logger>& GetClientLogger() { return s_ClientLogger; }
	private:
		static std::shared_ptr<spdlog::logger> s_CoreLogger;
		static std::shared_ptr<spdlog::logger> s_ClientLogger;
	};
}

//Core log macros
#define JENOVA_CORE_TRACE(...)   ::Jenova::Log::GetCoreLogger()->trace(__VA_ARGS__)
#define JENOVA_CORE_INFO(...)    ::Jenova::Log::GetCoreLogger()->info(__VA_ARGS__)
#define JENOVA_CORE_WARN(...)    ::Jenova::Log::GetCoreLogger()->warn(__VA_ARGS__)
#define JENOVA_CORE_ERROR(...)   ::Jenova::Log::GetCoreLogger()->error(__VA_ARGS__)
#define JENOVA_CORE_FATAL(...)   ::Jenova::Log::GetCoreLogger()->fatal(__VA_ARGS__)

//Client log macros
#define JENOVA_TRACE(...)        ::Jenova::Log::GetClientLogger()->trace(__VA_ARGS__)
#define JENOVA_INFO(...)         ::Jenova::Log::GetClientLogger()->info(__VA_ARGS__)
#define JENOVA_WARN(...)         ::Jenova::Log::GetClientLogger()->warn(__VA_ARGS__)
#define JENOVA_ERROR(...)        ::Jenova::Log::GetClientLogger()->error(__VA_ARGS__)
#define JENOVA_FATAL(...)        ::Jenova::Log::GetClientLogger()->fatal(__VA_ARGS__)