CoriEngine
Loading...
Searching...
No Matches
Logger.hpp File Reference
#include <spdlog/spdlog.h>
#include <spdlog/async.h>
#include <spdlog/sinks/rotating_file_sink.h>
#include <spdlog/fmt/ostr.h>
#include <spdlog/fmt/bundled/color.h>
#include <spdlog/fmt/bundled/base.h>
#include <spdlog/fmt/bundled/format.h>
#include "Utility/CleanTypeName.hpp"
#include <cstdlib>
Include dependency graph for Logger.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Cori::Logger
 Logger is the first thing that is initialized during startup. Does console and file logging. More...
struct  Cori::Logger::Tags
 Available logger tags in somewhat hierarchical state. These are used in CORI_DEBUGLEVEL_CORE_TAGGED logging calls. More...
struct  Cori::Logger::Tags::AssetManager
struct  Cori::Logger::Tags::Graphics
struct  Cori::Logger::Tags::Audio
struct  Cori::Logger::Tags::Core
struct  Cori::Logger::Tags::Core::Factory
struct  Cori::Logger::Tags::FileSystem
struct  Cori::Logger::Tags::Math
struct  Cori::Logger::Tags::World
struct  Cori::Logger::Tags::World::Scene
struct  Cori::Logger::Tags::World::Entity
struct  Cori::Logger::Tags::World::Systems
struct  Cori::Logger::Tags::Profiler
struct  Cori::Logger::Tags::Utility

Namespaces

namespace  Cori
 Global engine namespace.

Macros

#define BUGTRAP   std::abort()
#define CORI_CORE_TRACE(...)
#define CORI_CORE_DEBUG(...)
#define CORI_CORE_INFO(...)
#define CORI_CORE_TRACE_TAGGED(...)
#define CORI_CORE_DEBUG_TAGGED(...)
#define CORI_CORE_INFO_TAGGED(...)
#define CORI_CORE_ASSERT(x, ...)
#define CORI_CORE_VERIFY(x, ...)
#define CORI_CORE_WARN(...)
#define CORI_CORE_ERROR(...)
#define CORI_CORE_FATAL(...)
#define CORI_CORE_WARN_TAGGED(...)
#define CORI_CORE_ERROR_TAGGED(...)
#define CORI_CORE_FATAL_TAGGED(...)
#define CORI_CORE_CHECK(x, ...)
#define CORI_CORE_CHECK_EXPECTED(x)
#define CORI_ASSERT(x, ...)
#define CORI_VERIFY(x, ...)
#define CORI_CHECK(x, ...)
#define CORI_CHECK_EXPECTED(x)
#define CORI_TRACE(...)
#define CORI_DEBUG(...)
#define CORI_INFO(...)
#define CORI_WARN(...)
#define CORI_ERROR(...)
#define CORI_FATAL(...)
#define CORI_TRACE_TAGGED(...)
#define CORI_DEBUG_TAGGED(...)
#define CORI_INFO_TAGGED(...)
#define CORI_WARN_TAGGED(...)
#define CORI_ERROR_TAGGED(...)
#define CORI_FATAL_TAGGED(...)

Variables

const std::string CORI_SECOND_LINE_SPACING = "[" + std::string(43, '-') + "]: "

Macro Definition Documentation

◆ BUGTRAP

#define BUGTRAP   std::abort()

Definition at line 18 of file Logger.hpp.

◆ CORI_ASSERT

#define CORI_ASSERT ( x,
... )
Value:
if (!(x)) { (SPDLOG_LOGGER_CRITICAL(::Cori::Logger::GetClientLogger(), "Assertion '"#x"' Failed. Message: " __VA_ARGS__), ::Cori::Logger::GetClientLogger()->critical(" Function: {}", __PRETTY_FUNCTION__), spdlog::shutdown(), BUGTRAP); }
#define BUGTRAP
Definition Logger.hpp:18
static std::shared_ptr< spdlog::logger > & GetClientLogger()
Definition Logger.hpp:166

Definition at line 1047 of file Logger.hpp.

◆ CORI_CHECK

#define CORI_CHECK ( x,
... )
Value:
(!(x) ? (SPDLOG_LOGGER_ERROR(::Cori::Logger::GetClientLogger(), "Check '"#x"' Failed. Message: " __VA_ARGS__), ::Cori::Logger::GetClientLogger()->error(" Function: {}", __PRETTY_FUNCTION__), true) : false)

Definition at line 1049 of file Logger.hpp.

◆ CORI_CHECK_EXPECTED

#define CORI_CHECK_EXPECTED ( x)
Value:
CORI_CHECK(x, "std::expected returned an error, message: {}", x.error().what())
#define CORI_CHECK(x,...)
Definition Logger.hpp:1049

Definition at line 1050 of file Logger.hpp.

◆ CORI_CORE_ASSERT

#define CORI_CORE_ASSERT ( x,
... )

Definition at line 1029 of file Logger.hpp.

◆ CORI_CORE_CHECK

#define CORI_CORE_CHECK ( x,
... )
Value:
(!(x) ? (SPDLOG_LOGGER_ERROR(::Cori::Logger::GetCoreLogger(), "Check '"#x"' Failed. Message: " __VA_ARGS__), ::Cori::Logger::GetCoreLogger()->error(" Function: {}", __PRETTY_FUNCTION__), true) : false)
static std::shared_ptr< spdlog::logger > & GetCoreLogger()
Definition Logger.hpp:165

Definition at line 1042 of file Logger.hpp.

◆ CORI_CORE_CHECK_EXPECTED

#define CORI_CORE_CHECK_EXPECTED ( x)
Value:
CORI_CORE_CHECK(x, "std::expected returned an error, message: {}", x.error().what())
#define CORI_CORE_CHECK(x,...)
Definition Logger.hpp:1042

Definition at line 1043 of file Logger.hpp.

◆ CORI_CORE_DEBUG

#define CORI_CORE_DEBUG ( ...)

Definition at line 1022 of file Logger.hpp.

◆ CORI_CORE_DEBUG_TAGGED

#define CORI_CORE_DEBUG_TAGGED ( ...)

Definition at line 1026 of file Logger.hpp.

◆ CORI_CORE_ERROR

#define CORI_CORE_ERROR ( ...)
Value:
static void CoreLogError(const fmt::format_string< Args... > &fmt, Args &&... args)
Definition Logger.hpp:684

Definition at line 1035 of file Logger.hpp.

◆ CORI_CORE_ERROR_TAGGED

#define CORI_CORE_ERROR_TAGGED ( ...)
Value:
static void CoreLogErrorTagged(const std::initializer_list< const char * > tags, const fmt::format_string< Args... > &fmt, Args &&... args)
Definition Logger.hpp:389

Definition at line 1039 of file Logger.hpp.

◆ CORI_CORE_FATAL

#define CORI_CORE_FATAL ( ...)
Value:
static void CoreLogFatal(const fmt::format_string< Args... > &fmt, Args &&... args)
Definition Logger.hpp:702

Definition at line 1036 of file Logger.hpp.

◆ CORI_CORE_FATAL_TAGGED

#define CORI_CORE_FATAL_TAGGED ( ...)
Value:
static void CoreLogFatalTagged(const std::initializer_list< const char * > tags, const fmt::format_string< Args... > &fmt, Args &&... args)
Definition Logger.hpp:416

Definition at line 1040 of file Logger.hpp.

◆ CORI_CORE_INFO

#define CORI_CORE_INFO ( ...)

Definition at line 1023 of file Logger.hpp.

◆ CORI_CORE_INFO_TAGGED

#define CORI_CORE_INFO_TAGGED ( ...)

Definition at line 1027 of file Logger.hpp.

◆ CORI_CORE_TRACE

#define CORI_CORE_TRACE ( ...)

Definition at line 1021 of file Logger.hpp.

◆ CORI_CORE_TRACE_TAGGED

#define CORI_CORE_TRACE_TAGGED ( ...)

Definition at line 1025 of file Logger.hpp.

◆ CORI_CORE_VERIFY

#define CORI_CORE_VERIFY ( x,
... )
Value:
(!x)

Definition at line 1030 of file Logger.hpp.

◆ CORI_CORE_WARN

#define CORI_CORE_WARN ( ...)
Value:
static void CoreLogWarn(const fmt::format_string< Args... > &fmt, Args &&... args)
Definition Logger.hpp:666

Definition at line 1034 of file Logger.hpp.

◆ CORI_CORE_WARN_TAGGED

#define CORI_CORE_WARN_TAGGED ( ...)
Value:
static void CoreLogWarnTagged(const std::initializer_list< const char * > tags, const fmt::format_string< Args... > &fmt, Args &&... args)
Definition Logger.hpp:362

Definition at line 1038 of file Logger.hpp.

◆ CORI_DEBUG

#define CORI_DEBUG ( ...)
Value:
static void ClientLogDebug(const fmt::format_string< Args... > &fmt, Args &&... args)
Definition Logger.hpp:740

Definition at line 1053 of file Logger.hpp.

◆ CORI_DEBUG_TAGGED

#define CORI_DEBUG_TAGGED ( ...)
Value:
static void ClientLogDebugTagged(const std::initializer_list< const char * > tags, const fmt::format_string< Args... > &fmt, Args &&... args)
Definition Logger.hpp:472

Definition at line 1060 of file Logger.hpp.

◆ CORI_ERROR

#define CORI_ERROR ( ...)
Value:
static void ClientLogError(const fmt::format_string< Args... > &fmt, Args &&... args)
Definition Logger.hpp:794

Definition at line 1056 of file Logger.hpp.

◆ CORI_ERROR_TAGGED

#define CORI_ERROR_TAGGED ( ...)
Value:
static void ClientLogErrorTagged(const std::initializer_list< const char * > tags, const fmt::format_string< Args... > &fmt, Args &&... args)
Definition Logger.hpp:553

Definition at line 1063 of file Logger.hpp.

◆ CORI_FATAL

#define CORI_FATAL ( ...)
Value:
static void ClientLogFatal(const fmt::format_string< Args... > &fmt, Args &&... args)
Definition Logger.hpp:812

Definition at line 1057 of file Logger.hpp.

◆ CORI_FATAL_TAGGED

#define CORI_FATAL_TAGGED ( ...)
Value:
static void ClientLogFatalTagged(const std::initializer_list< const char * > tags, const fmt::format_string< Args... > &fmt, Args &&... args)
Definition Logger.hpp:580

Definition at line 1064 of file Logger.hpp.

◆ CORI_INFO

#define CORI_INFO ( ...)
Value:
static void ClientLogInfo(const fmt::format_string< Args... > &fmt, Args &&... args)
Definition Logger.hpp:758

Definition at line 1054 of file Logger.hpp.

◆ CORI_INFO_TAGGED

#define CORI_INFO_TAGGED ( ...)
Value:
static void ClientLogInfoTagged(const std::initializer_list< const char * > tags, const fmt::format_string< Args... > &fmt, Args &&... args)
Definition Logger.hpp:499

Definition at line 1061 of file Logger.hpp.

◆ CORI_TRACE

#define CORI_TRACE ( ...)
Value:
static void ClientLogTrace(const fmt::format_string< Args... > &fmt, Args &&... args)
Definition Logger.hpp:722

Definition at line 1052 of file Logger.hpp.

◆ CORI_TRACE_TAGGED

#define CORI_TRACE_TAGGED ( ...)
Value:
static void ClientLogTraceTagged(const std::initializer_list< const char * > tags, const fmt::format_string< Args... > &fmt, Args &&... args)
Definition Logger.hpp:445

Definition at line 1059 of file Logger.hpp.

◆ CORI_VERIFY

#define CORI_VERIFY ( x,
... )
Value:
(!(x) ? (SPDLOG_LOGGER_CRITICAL(::Cori::Logger::GetClientLogger(), "Verify '"#x"' Failed. Message: " __VA_ARGS__), ::Cori::Logger::GetClientLogger()->critical(" Function: {}", __PRETTY_FUNCTION__), true) : false)

Definition at line 1048 of file Logger.hpp.

◆ CORI_WARN

#define CORI_WARN ( ...)
Value:
static void ClientLogWarn(const fmt::format_string< Args... > &fmt, Args &&... args)
Definition Logger.hpp:776

Definition at line 1055 of file Logger.hpp.

◆ CORI_WARN_TAGGED

#define CORI_WARN_TAGGED ( ...)
Value:
static void ClientLogWarnTagged(const std::initializer_list< const char * > tags, const fmt::format_string< Args... > &fmt, Args &&... args)
Definition Logger.hpp:526

Definition at line 1062 of file Logger.hpp.

Variable Documentation

◆ CORI_SECOND_LINE_SPACING

const std::string CORI_SECOND_LINE_SPACING = "[" + std::string(43, '-') + "]: "
inline

Definition at line 1001 of file Logger.hpp.