Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
LogMacros.h File Reference
#include "LogCategory.h"
#include <plog/Log.h>
#include <format>
#include <string>
Include dependency graph for LogMacros.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  EngineCore
 Log category system implementation.

Macros

#define VS_LOG_COMPILE_TIME_VERBOSITY   ::EngineCore::LogVerbosity::Verbose
 Compile-time check if a verbosity level should be compiled in.
#define VS_LOG(Category, Verbosity, Format, ...)
 Log a message with category and verbosity.
#define VS_LOG_SIMPLE(Category, Verbosity, Message)
 Log a simple message without format arguments.
#define VS_CLOG(Condition, Category, Verbosity, Format, ...)
 Conditional log - only logs if condition is true.
#define VS_LOG_ONCE(Category, Verbosity, Format, ...)
 Log once - only logs the first time this line is executed.
#define VS_LOG_FATAL(Category, Format, ...)
#define VS_LOG_ERROR(Category, Format, ...)
#define VS_LOG_WARNING(Category, Format, ...)
#define VS_LOG_INFO(Category, Format, ...)
#define VS_LOG_DEBUG(Category, Format, ...)
#define VS_LOG_VERBOSE(Category, Format, ...)

Functions

template<typename... Args>
void EngineCore::logImpl (LogCategory &category, LogVerbosity verbosity, const char *file, int line, const char *func, std::format_string< Args... > fmt, Args &&... args)
 Internal helper to format and output a log message.
void EngineCore::logImplSimple (LogCategory &category, LogVerbosity verbosity, const char *file, int line, const char *func, const char *message)
 Internal helper for messages without format arguments.

Macro Definition Documentation

◆ VS_CLOG

#define VS_CLOG ( Condition,
Category,
Verbosity,
Format,
... )
Value:
do { \
if (Condition) { \
VS_LOG(Category, Verbosity, Format __VA_OPT__(,) __VA_ARGS__); \
} \
} while (0)

Conditional log - only logs if condition is true.

Parameters
ConditionBoolean expression
CategoryLogCategory instance
VerbosityLogVerbosity level
Formatstd::format compatible format string
...Format arguments

Definition at line 158 of file LogMacros.h.

◆ VS_LOG

#define VS_LOG ( Category,
Verbosity,
Format,
... )
Value:
do { \
if constexpr (static_cast<uint8_t>(::EngineCore::LogVerbosity::Verbosity) <= \
static_cast<uint8_t>(VS_LOG_COMPILE_TIME_VERBOSITY)) { \
if (!Category.isSuppressed(::EngineCore::LogVerbosity::Verbosity)) { \
::EngineCore::logImpl(Category, ::EngineCore::LogVerbosity::Verbosity, \
__FILE__, __LINE__, __func__, Format __VA_OPT__(,) __VA_ARGS__); \
} \
} \
} while (0)
#define VS_LOG_COMPILE_TIME_VERBOSITY
Compile-time check if a verbosity level should be compiled in.
Definition LogMacros.h:103

Log a message with category and verbosity.

Parameters
CategoryLogCategory instance (e.g., LogLOD)
VerbosityLogVerbosity level (e.g., Info, Warning, Verbose)
Formatstd::format compatible format string
...Format arguments

Example: VS_LOG(LogLOD, Info, "Generated {} clusters in {} ms", clusterCount, timeMs);

Definition at line 122 of file LogMacros.h.

Referenced by EngineCore::ClusterLodGenerator::generate(), EngineCore::Renderer::renderToXr(), and EngineCore::RenderingDataManager::updatePrimitiveDataInstanced().

◆ VS_LOG_COMPILE_TIME_VERBOSITY

#define VS_LOG_COMPILE_TIME_VERBOSITY   ::EngineCore::LogVerbosity::Verbose

Compile-time check if a verbosity level should be compiled in.

In Release builds, you can define VS_LOG_COMPILE_TIME_VERBOSITY to strip verbose logs entirely. Default is Verbose (all logs compiled in).

Definition at line 103 of file LogMacros.h.

◆ VS_LOG_DEBUG

#define VS_LOG_DEBUG ( Category,
Format,
... )
Value:
VS_LOG(Category, Debug, Format __VA_OPT__(,) __VA_ARGS__)
#define VS_LOG(Category, Verbosity, Format,...)
Log a message with category and verbosity.
Definition LogMacros.h:122

Definition at line 185 of file LogMacros.h.

◆ VS_LOG_ERROR

#define VS_LOG_ERROR ( Category,
Format,
... )
Value:
VS_LOG(Category, Error, Format __VA_OPT__(,) __VA_ARGS__)

Definition at line 182 of file LogMacros.h.

◆ VS_LOG_FATAL

#define VS_LOG_FATAL ( Category,
Format,
... )
Value:
VS_LOG(Category, Fatal, Format __VA_OPT__(,) __VA_ARGS__)

Definition at line 181 of file LogMacros.h.

◆ VS_LOG_INFO

#define VS_LOG_INFO ( Category,
Format,
... )
Value:
VS_LOG(Category, Info, Format __VA_OPT__(,) __VA_ARGS__)

Definition at line 184 of file LogMacros.h.

◆ VS_LOG_ONCE

#define VS_LOG_ONCE ( Category,
Verbosity,
Format,
... )
Value:
do { \
static bool _vs_logged_once = false; \
if (!_vs_logged_once) { \
_vs_logged_once = true; \
VS_LOG(Category, Verbosity, Format __VA_OPT__(,) __VA_ARGS__); \
} \
} while (0)

Log once - only logs the first time this line is executed.

Definition at line 168 of file LogMacros.h.

Referenced by EngineCore::Renderer::renderToXr().

◆ VS_LOG_SIMPLE

#define VS_LOG_SIMPLE ( Category,
Verbosity,
Message )
Value:
do { \
if constexpr (static_cast<uint8_t>(::EngineCore::LogVerbosity::Verbosity) <= \
static_cast<uint8_t>(VS_LOG_COMPILE_TIME_VERBOSITY)) { \
if (!Category.isSuppressed(::EngineCore::LogVerbosity::Verbosity)) { \
::EngineCore::logImplSimple(Category, ::EngineCore::LogVerbosity::Verbosity, \
__FILE__, __LINE__, __func__, Message); \
} \
} \
} while (0)

Log a simple message without format arguments.

Slightly more efficient when no formatting is needed.

Definition at line 138 of file LogMacros.h.

◆ VS_LOG_VERBOSE

#define VS_LOG_VERBOSE ( Category,
Format,
... )
Value:
VS_LOG(Category, Verbose, Format __VA_OPT__(,) __VA_ARGS__)

Definition at line 186 of file LogMacros.h.

◆ VS_LOG_WARNING

#define VS_LOG_WARNING ( Category,
Format,
... )
Value:
VS_LOG(Category, Warning, Format __VA_OPT__(,) __VA_ARGS__)

Definition at line 183 of file LogMacros.h.