QuasarEngine
Cross-platform 3D engine and editor
Loading...
Searching...
No Matches
Log.h File Reference

Engine and application loggers, and the macros to write to them. More...

#include <quasar/core/PlatformDetection.h>
#include <spdlog/spdlog.h>
#include <cstddef>
#include <memory>

Go to the source code of this file.

Classes

class  Quasar::Log
 The loggers for the engine and the application. More...

Namespaces

namespace  Quasar
 Contains all the engine code.

Macros

#define QUASAR_ENGINE_TRACE(...)
 Writes a trace message from the engine.
#define QUASAR_TRACE(...)
 Writes a trace message from the application.
#define QUASAR_ENGINE_INFO(...)
 Writes an info message from the engine.
#define QUASAR_ENGINE_WARN(...)
 Writes a warning message from the engine.
#define QUASAR_ENGINE_ERROR(...)
 Writes an error message from the engine.
#define QUASAR_INFO(...)
 Writes an info message from the application.
#define QUASAR_WARN(...)
 Writes a warning message from the application.
#define QUASAR_ERROR(...)
 Writes an error message from the application.

Detailed Description

Engine and application loggers, and the macros to write to them.

Author
Kurogenshi
Date
2026-10-19

The macros take a format string and its arguments, with the fmt syntax: QUASAR_ENGINE_INFO("Loaded {} meshes", count). Engine code uses the QUASAR_ENGINE_ macros, and application code uses the QUASAR_ macros. Messages written before Log::Init() or after Log::Shutdown() go to the error output.

Macro Definition Documentation

◆ QUASAR_ENGINE_TRACE

#define QUASAR_ENGINE_TRACE ( ...)
Value:
do \
{ \
if constexpr (false) \
{ \
::Quasar::Log::Engine().trace(__VA_ARGS__); \
} \
} while (false)

Writes a trace message from the engine.

Removed from Release builds, where its arguments are still checked by the compiler but never evaluated.

◆ QUASAR_TRACE

#define QUASAR_TRACE ( ...)
Value:
do \
{ \
if constexpr (false) \
{ \
::Quasar::Log::App().trace(__VA_ARGS__); \
} \
} while (false)

Writes a trace message from the application.

Removed from Release builds, where its arguments are still checked by the compiler but never evaluated.

◆ QUASAR_ENGINE_INFO

#define QUASAR_ENGINE_INFO ( ...)
Value:
::Quasar::Log::Engine().info(__VA_ARGS__)
static spdlog::logger & Engine()
Returns the logger for engine messages.
Definition Log.h:42

Writes an info message from the engine.

The message is written in Debug and Release builds.

◆ QUASAR_ENGINE_WARN

#define QUASAR_ENGINE_WARN ( ...)
Value:
::Quasar::Log::Engine().warn(__VA_ARGS__)

Writes a warning message from the engine.

The message is written in Debug and Release builds.

◆ QUASAR_ENGINE_ERROR

#define QUASAR_ENGINE_ERROR ( ...)
Value:
::Quasar::Log::Engine().error(__VA_ARGS__)

Writes an error message from the engine.

The message is written in Debug and Release builds.

◆ QUASAR_INFO

#define QUASAR_INFO ( ...)
Value:
::Quasar::Log::App().info(__VA_ARGS__)
static spdlog::logger & App()
Returns the logger for application messages.
Definition Log.h:48

Writes an info message from the application.

The message is written in Debug and Release builds.

◆ QUASAR_WARN

#define QUASAR_WARN ( ...)
Value:
::Quasar::Log::App().warn(__VA_ARGS__)

Writes a warning message from the application.

The message is written in Debug and Release builds.

◆ QUASAR_ERROR

#define QUASAR_ERROR ( ...)
Value:
::Quasar::Log::App().error(__VA_ARGS__)

Writes an error message from the application.

The message is written in Debug and Release builds.