ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
Loading...
Searching...
No Matches
log.h File Reference

Structured logging system. More...

#include <format>
#include <iostream>
#include <string>
Include dependency graph for log.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  asw
 
namespace  asw::log
 

Enumerations

enum class  asw::log::Level { asw::log::DEBUG , asw::log::INFO , asw::log::WARN , asw::log::ERROR }
 Log severity levels. More...
 

Functions

void asw::log::log_message (Level level, const std::string &message)
 Log a message at the specified level. Messages below the current log level are ignored.
 
void asw::log::set_level (Level level)
 Set the minimum log level (messages below this are ignored).
 
void asw::log::set_output (std::ostream &stream)
 Set the output stream (default: std::cerr).
 
void asw::log::debug (const std::string &message)
 Log a debug message.
 
template<typename... Args>
void asw::log::debug (std::format_string< Args... > format, Args &&... args)
 Log a formatted debug message.
 
void asw::log::info (const std::string &message)
 Log an info message.
 
template<typename... Args>
void asw::log::info (std::format_string< Args... > format, Args &&... args)
 Log a formatted info message.
 
void asw::log::warn (const std::string &message)
 Log a warning message.
 
template<typename... Args>
void asw::log::warn (std::format_string< Args... > format, Args &&... args)
 Log a formatted warning message.
 
void asw::log::error (const std::string &message)
 Log an error message.
 
template<typename... Args>
void asw::log::error (std::format_string< Args... > format, Args &&... args)
 Log a formatted error message.
 
void asw::log::progress (float progress, std::string message)
 Log a progress message with a percentage.
 
template<typename... Args>
void asw::log::progress (float prog, std::format_string< Args... > format, Args &&... args)
 Log a progress message with a percentage.
 

Detailed Description

Structured logging system.

Author
Allan Legemaate (alege.nosp@m.maat.nosp@m.e@gma.nosp@m.il.c.nosp@m.om)
Date
2026-02-13

Definition in file log.h.