Sink based logging system.
More...
#include <Log.hpp>
|
| | Log () noexcept |
| | Constructor.
|
| |
| | ~Log () noexcept |
| | Destructor.
|
| |
| template<std::derived_from< Sink > SinkTo, typename... Args> |
| SinkTo & | add_sink (Args &&... args) |
| | Add a sink to log to.
|
| |
| template<LogLevel level> |
| void | set_min_level () noexcept |
| | Set a minimum log level.
|
| |
| template<LogLevel level, typename... MsgInputs> |
| void | log (const std::stacktrace &trace, const std::source_location &loc, std::string_view message, const MsgInputs &... args) |
| | Log a message.
|
| |
Sink based logging system.
Use macros to access.
Definition at line 37 of file Log.hpp.
◆ Log() [1/3]
Constructor.
Definition at line 38 of file Log.cpp.
◆ ~Log()
Destructor.
Definition at line 45 of file Log.cpp.
◆ Log() [2/3]
| galaxy::Log::Log |
( |
const Log & | | ) |
|
|
privatedelete |
◆ Log() [3/3]
| galaxy::Log::Log |
( |
Log && | | ) |
|
|
privatedelete |
◆ add_sink()
template<std::derived_from<
Sink > SinkTo, typename... Args>
| SinkTo & galaxy::Log::add_sink |
( |
Args &&... | args | ) |
|
|
inline |
Add a sink to log to.
- Template Parameters
-
| SinkTo | The derived type of the sink. |
| Args | Variadic arguments for sink constructor. |
- Parameters
-
| args | Constructor arguments for a sink. Can be blank. |
- Returns
- A pointer to the newly created sink.
Definition at line 122 of file Log.hpp.
◆ set_min_level()
| void galaxy::Log::set_min_level |
( |
| ) |
|
|
inlinenoexcept |
Set a minimum log level.
In order to only print and log levels greater than or equal to the current log message level.
- Template Parameters
-
| level | Must be a LogLevel enum value. |
Definition at line 130 of file Log.hpp.
◆ log()
template<
LogLevel level, typename... MsgInputs>
| void galaxy::Log::log |
( |
const std::stacktrace & | trace, |
|
|
const std::source_location & | loc, |
|
|
std::string_view | message, |
|
|
const MsgInputs &... | args ) |
|
inline |
Log a message.
- Template Parameters
-
| level | Must be a LogLevel enum value. |
| MsgInputs | Variadic arguments for std::format string. |
- Parameters
-
| trace | Stacktrace for error. |
| loc | Source location argument. |
| message | Message template to log. |
| args | std::format supported arguments to be formatted into a string. |
Definition at line 136 of file Log.hpp.
◆ operator=() [1/2]
| Log & galaxy::Log::operator= |
( |
const Log & | | ) |
|
|
privatedelete |
Copy assignment operator.
◆ operator=() [2/2]
| Log & galaxy::Log::operator= |
( |
Log && | | ) |
|
|
privatedelete |
Move assignment operator.
◆ m_min_level
Minimum level for a message to be logged.
Definition at line 113 of file Log.hpp.
◆ m_sinks
| std::vector<std::unique_ptr<Sink> > galaxy::Log::m_sinks |
|
private |
List of sinks.
Definition at line 118 of file Log.hpp.
The documentation for this class was generated from the following files: