Class Logger

Class Documentation

class Logger

Central logging facility for AMS. Provides thread-safe, fmt-based output with compile-time filtering.

Public Functions

inline void setLevel(LogLevel lvl) noexcept

Sets the runtime logging verbosity.

inline LogLevel getLevel() const noexcept

Returns the current runtime log level.

inline void setConfig(const LogConfig &cfg) noexcept

Applies a new log configuration.

void setOutputFile(const std::string &path)

Redirects logging output to the given file path.

inline void setOutputStdout() noexcept

Redirects logging to stdout.

inline void setOutputStderr() noexcept

Redirects logging to stderr.

template<typename ...Args>
inline void log(LogLevel lvl, const char *Descr, fmt::format_string<Args...> fmtstr, Args&&... args)

Logs a message using fmt formatting.

inline bool isEnabled(LogLevel lvl) const noexcept

Returns true if the runtime level allows logging the given level.

inline void flush()

Flushes the output stream.

Public Static Functions

static Logger &get()

Returns the global AMS logger instance.

static inline constexpr const char *toString(LogLevel lvl)

Returns a string representation of the log level.

static inline LogLevel fromString(std::optional<std::string> LvlStr)