Helios Engine 0.1.0
A modular ECS based data-oriented C++23 game engine
 
Loading...
Searching...
No Matches
logger.hpp File Reference
#include <helios/core_pch.hpp>
#include <ctti/type_id.hpp>
#include <concepts>
#include <cstddef>
#include <cstdint>
#include <filesystem>
#include <format>
#include <memory>
#include <mutex>
#include <shared_mutex>
#include <source_location>
#include <string>
#include <string_view>
#include <type_traits>
#include <unordered_map>
#include <utility>

Go to the source code of this file.

Classes

struct  helios::LoggerConfig
 Configuration for logger behavior and output. More...
 
struct  helios::DefaultLogger
 Default logger type. More...
 
class  helios::Logger
 Centralized logging system with configurable output and formatting. More...
 

Namespaces

namespace  spdlog
 
namespace  helios
 
namespace  helios::details
 

Concepts

concept  helios::LoggerTrait
 
concept  helios::LoggerWithConfigTrait
 

Macros

#define HELIOS_DEBUG(...)   [[maybe_unused]] static constexpr auto HELIOS_ANONYMOUS_VAR(unused_debug) = 0
 
#define HELIOS_DEBUG_LOGGER(logger, ...)    [[maybe_unused]] static constexpr auto HELIOS_ANONYMOUS_VAR(unused_debug_logger) = 0
 
#define HELIOS_TRACE(...)   [[maybe_unused]] static constexpr auto HELIOS_ANONYMOUS_VAR(unused_trace) = 0
 
#define HELIOS_TRACE_LOGGER(logger, ...)    [[maybe_unused]] static constexpr auto HELIOS_ANONYMOUS_VAR(unused_trace_logger) = 0
 
#define HELIOS_INFO(...)    ::helios::Logger::GetInstance().LogMessage(::helios::LogLevel::kInfo, std::source_location::current(), __VA_ARGS__)
 
#define HELIOS_WARN(...)    ::helios::Logger::GetInstance().LogMessage(::helios::LogLevel::kWarn, std::source_location::current(), __VA_ARGS__)
 
#define HELIOS_ERROR(...)    ::helios::Logger::GetInstance().LogMessage(::helios::LogLevel::kError, std::source_location::current(), __VA_ARGS__)
 
#define HELIOS_CRITICAL(...)
 
#define HELIOS_INFO_LOGGER(logger, ...)
 
#define HELIOS_WARN_LOGGER(logger, ...)
 
#define HELIOS_ERROR_LOGGER(logger, ...)
 
#define HELIOS_CRITICAL_LOGGER(logger, ...)
 

Typedefs

using helios::LoggerId = size_t
 Type alias for logger type IDs.
 

Enumerations

enum class  helios::LogLevel : uint8_t {
  helios::kTrace = 0 , helios::kDebug = 1 , helios::kInfo = 2 , helios::kWarn = 3 ,
  helios::kError = 4 , helios::kCritical = 5
}
 Log severity levels. More...
 

Functions

template<LoggerTrait T>
constexpr LoggerId helios::LoggerIdOf () noexcept
 
template<LoggerTrait T>
constexpr std::string_view helios::LoggerNameOf () noexcept
 
template<LoggerTrait T>
LoggerConfig helios::LoggerConfigOf () noexcept
 
void helios::details::LogAssertionFailureViaLogger (std::string_view condition, const std::source_location &loc, std::string_view message) noexcept
 Bridge to logger-provided assertion logging.
 

Variables

constexpr DefaultLogger helios::kDefaultLogger {}
 Constexpr instance of the default logger for easier user interface.
 

Macro Definition Documentation

◆ HELIOS_CRITICAL

#define HELIOS_CRITICAL (   ...)
Value:
__VA_ARGS__)
static Logger & GetInstance() noexcept
Gets the singleton instance.
Definition logger.hpp:447
void LogMessage(T logger, LogLevel level, const std::source_location &loc, std::string_view message) noexcept
Logs a string message with typed logger.
Definition logger.hpp:557
Examples
/home/runner/work/HeliosEngine/HeliosEngine/src/core/include/helios/core/app/runners.hpp.

Definition at line 691 of file logger.hpp.

◆ HELIOS_CRITICAL_LOGGER

#define HELIOS_CRITICAL_LOGGER (   logger,
  ... 
)
Value:
::helios::Logger::GetInstance().LogMessage(logger, ::helios::LogLevel::kCritical, std::source_location::current(), \
__VA_ARGS__)

Definition at line 704 of file logger.hpp.

◆ HELIOS_DEBUG

#define HELIOS_DEBUG (   ...)    [[maybe_unused]] static constexpr auto HELIOS_ANONYMOUS_VAR(unused_debug) = 0

Definition at line 667 of file logger.hpp.

◆ HELIOS_DEBUG_LOGGER

#define HELIOS_DEBUG_LOGGER (   logger,
  ... 
)     [[maybe_unused]] static constexpr auto HELIOS_ANONYMOUS_VAR(unused_debug_logger) = 0

Definition at line 668 of file logger.hpp.

◆ HELIOS_ERROR

◆ HELIOS_ERROR_LOGGER

#define HELIOS_ERROR_LOGGER (   logger,
  ... 
)
Value:
::helios::Logger::GetInstance().LogMessage(logger, ::helios::LogLevel::kError, std::source_location::current(), \
__VA_ARGS__)

Definition at line 701 of file logger.hpp.

◆ HELIOS_INFO

#define HELIOS_INFO (   ...)     ::helios::Logger::GetInstance().LogMessage(::helios::LogLevel::kInfo, std::source_location::current(), __VA_ARGS__)

◆ HELIOS_INFO_LOGGER

#define HELIOS_INFO_LOGGER (   logger,
  ... 
)
Value:
::helios::Logger::GetInstance().LogMessage(logger, ::helios::LogLevel::kInfo, std::source_location::current(), \
__VA_ARGS__)

Definition at line 695 of file logger.hpp.

◆ HELIOS_TRACE

#define HELIOS_TRACE (   ...)    [[maybe_unused]] static constexpr auto HELIOS_ANONYMOUS_VAR(unused_trace) = 0

Definition at line 680 of file logger.hpp.

◆ HELIOS_TRACE_LOGGER

#define HELIOS_TRACE_LOGGER (   logger,
  ... 
)     [[maybe_unused]] static constexpr auto HELIOS_ANONYMOUS_VAR(unused_trace_logger) = 0

Definition at line 681 of file logger.hpp.

◆ HELIOS_WARN

◆ HELIOS_WARN_LOGGER

#define HELIOS_WARN_LOGGER (   logger,
  ... 
)
Value:
::helios::Logger::GetInstance().LogMessage(logger, ::helios::LogLevel::kWarn, std::source_location::current(), \
__VA_ARGS__)

Definition at line 698 of file logger.hpp.