2#include <core/core.hpp>
4#include <fmt/ostream.h>
6#include <spdlog/common.h>
7#include <spdlog/spdlog.h>
25 const std::string& pattern =
"%^[%T] %n: %v%$");
31 const std::string& p_tag =
"Undefined g_Tag in console_logger");
37 const std::string& p_tag =
"Undefined Tag");
47 static ref<spdlog::logger>
get(
const std::string& p_tag);
52 static std::unordered_map<std::string, ref<spdlog::logger>> s_loggers;
60template<
typename... T>
62console_log_trace([[maybe_unused]] spdlog::format_string_t<T...> fmt,
63 [[maybe_unused]] T&&... args) {
64#ifndef ENABLE_TESTS_ONLY
66 ->trace(fmt, std::forward<T>(args)...);
70template<
typename... T>
72console_log_warn([[maybe_unused]] spdlog::format_string_t<T...> fmt,
73 [[maybe_unused]] T&&... args) {
74#ifndef ENABLE_TESTS_ONLY
76 ->warn(fmt, std::forward<T>(args)...);
80template<
typename... T>
82console_log_info([[maybe_unused]] spdlog::format_string_t<T...> fmt,
83 [[maybe_unused]] T&&... args) {
84#ifndef ENABLE_TESTS_ONLY
86 ->info(fmt, std::forward<T>(args)...);
90template<
typename... T>
92console_log_error([[maybe_unused]] spdlog::format_string_t<T...> fmt,
93 [[maybe_unused]] T&&... args) {
94#ifndef ENABLE_TESTS_ONLY
96 ->error(fmt, std::forward<T>(args)...);
100template<
typename... T>
102console_log_fatal([[maybe_unused]] spdlog::format_string_t<T...> fmt,
103 [[maybe_unused]] T&&... args) {
104#ifndef ENABLE_TESTS_ONLY
106 ->critical(fmt, std::forward<T>(args)...);
113template<
typename... T>
115console_log_trace_tagged([[maybe_unused]]
const std::string& p_tag,
116 [[maybe_unused]] spdlog::format_string_t<T...> fmt,
117 [[maybe_unused]] T&&... args) {
118#ifndef ENABLE_TESTS_ONLY
120 std::forward<T>(args)...);
124template<
typename... T>
126console_log_info_tagged([[maybe_unused]]
const std::string& p_tag,
127 [[maybe_unused]] spdlog::format_string_t<T...> fmt,
128 [[maybe_unused]] T&&... args) {
129#ifndef ENABLE_TESTS_ONLY
134template<
typename... T>
136console_log_warn_tagged([[maybe_unused]]
const std::string& p_tag,
137 [[maybe_unused]] spdlog::format_string_t<T...> fmt,
138 [[maybe_unused]] T&&... args) {
142template<
typename... T>
144console_log_error_tagged([[maybe_unused]]
const std::string& p_tag,
145 [[maybe_unused]] spdlog::format_string_t<T...> fmt,
146 [[maybe_unused]] T&&... args) {
147#ifndef ENABLE_TESTS_ONLY
149 std::forward<T>(args)...);
153template<
typename... T>
155console_log_fatal_tagged([[maybe_unused]]
const std::string& p_tag,
156 [[maybe_unused]] spdlog::format_string_t<T...> fmt,
157 [[maybe_unused]] T&&... args) {
158#ifndef ENABLE_TESTS_ONLY
160 std::forward<T>(args)...);
logger for logging messages to stdout on the console
Definition engine_logger.hpp:16
static void create_new_logger(const std::string &p_tag="Undefined Tag")
constructs a new spdlog::logger to write to the console
static ref< spdlog::logger > get(const std::string &p_tag)
retrieves that specific logger if it has been constructed
static void initialize_logger_manager(const std::string &pattern="%^[%T] %n: %v%$")
initializes the console_log_manager
static void set_current_logger(const std::string &p_tag="Undefined g_Tag in console_logger")
sets what the current logger to write to the console with