42#ifndef RTYPE_LOGGER_HPP_
43 #define RTYPE_LOGGER_HPP_
50 #include <source_location>
52 #include <string_view>
53 #include <type_traits>
58 template <
typename... Args>
60 std::format_string<Args...>
fmt;
61 std::source_location
loc;
64 std::source_location l =
65 std::source_location::current())
71 std::source_location l =
72 std::source_location::current())
85 auto configure(std::string_view logFilePath)
noexcept
86 -> std::expected<void, rtp::Error>;
94 template <
typename... Args>
96 Args &&...args)
noexcept;
104 template <
typename... Args>
106 Args &&...args)
noexcept;
114 template <
typename... Args>
116 Args &&...args)
noexcept;
124 template <
typename... Args>
126 Args &&...args)
noexcept;
134 template <
typename... Args>
136 Args &&...args)
noexcept;
145 const std::source_location &loc);
Error handling system with categorized error codes.
Log severity levels for the logging system.
void logImpl(Level level, std::string_view message, const std::source_location &loc)
Level
Severity levels for log messages.
void fatal(LogFmt< std::type_identity_t< Args >... > fmt, Args &&...args) noexcept
Log a fatal error message.
auto configure(std::string_view logFilePath) noexcept -> std::expected< void, rtp::Error >
Configure the logger using a configuration file.
void error(LogFmt< std::type_identity_t< Args >... > fmt, Args &&...args) noexcept
Log an error message.
void warning(LogFmt< std::type_identity_t< Args >... > fmt, Args &&...args) noexcept
Log a warning message.
void info(LogFmt< std::type_identity_t< Args >... > fmt, Args &&...args) noexcept
Log an informational message.
void debug(LogFmt< std::type_identity_t< Args >... > fmt, Args &&...args) noexcept
Log a debug message.
consteval LogFmt(const char *s, std::source_location l=std::source_location::current())
consteval LogFmt(std::string_view s, std::source_location l=std::source_location::current())
std::format_string< Args... > fmt