Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
Loading...
Searching...
No Matches
aria::runtime::Logger Class Reference

Process-wide logger. More...

#include <logger.hpp>

Public Types

using Sink = std::function<void(LogLevel, std::string_view, std::string_view )>

Public Member Functions

 Logger (const Logger &)=delete
Loggeroperator= (const Logger &)=delete
 Logger (Logger &&)=delete
Loggeroperator= (Logger &&)=delete
void set_sink (Sink sink)
void set_level (LogLevel level) noexcept
LogLevel level () const noexcept
void log (LogLevel level, std::string_view category, std::string_view message) noexcept
 Invoke the current sink without copying its captures.
void trace (std::string_view category, std::string_view m)
void debug (std::string_view category, std::string_view m)
void info (std::string_view category, std::string_view m)
void warn (std::string_view category, std::string_view m)
void error (std::string_view category, std::string_view m)
void fatal (std::string_view category, std::string_view m)

Static Public Member Functions

static Loggerinstance () noexcept
 Get the singleton (resolved from the runtime shared library, never duplicated).

Detailed Description

Process-wide logger.

Implementation lives in the runtime shared library, so there is exactly one global sink across all modules.

Member Typedef Documentation

◆ Sink

using aria::runtime::Logger::Sink = std::function<void(LogLevel, std::string_view, std::string_view )>

Constructor & Destructor Documentation

◆ Logger() [1/2]

aria::runtime::Logger::Logger ( const Logger & )
delete

◆ Logger() [2/2]

aria::runtime::Logger::Logger ( Logger && )
delete

Member Function Documentation

◆ instance()

Logger & aria::runtime::Logger::instance ( )
staticnoexcept

Get the singleton (resolved from the runtime shared library, never duplicated).

◆ operator=() [1/2]

Logger & aria::runtime::Logger::operator= ( const Logger & )
delete

◆ operator=() [2/2]

Logger & aria::runtime::Logger::operator= ( Logger && )
delete

◆ set_sink()

void aria::runtime::Logger::set_sink ( Sink sink)

◆ set_level()

void aria::runtime::Logger::set_level ( LogLevel level)
noexcept

◆ level()

LogLevel aria::runtime::Logger::level ( ) const
nodiscardnoexcept

◆ log()

void aria::runtime::Logger::log ( LogLevel level,
std::string_view category,
std::string_view message )
noexcept

Invoke the current sink without copying its captures.

Sink exceptions and recursive logging fall back to stderr.

◆ trace()

void aria::runtime::Logger::trace ( std::string_view category,
std::string_view m )
inline

◆ debug()

void aria::runtime::Logger::debug ( std::string_view category,
std::string_view m )
inline

◆ info()

void aria::runtime::Logger::info ( std::string_view category,
std::string_view m )
inline

◆ warn()

void aria::runtime::Logger::warn ( std::string_view category,
std::string_view m )
inline

◆ error()

void aria::runtime::Logger::error ( std::string_view category,
std::string_view m )
inline

◆ fatal()

void aria::runtime::Logger::fatal ( std::string_view category,
std::string_view m )
inline

The documentation for this class was generated from the following file: