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::source_location &loc, std::string_view message, const MsgInputs &... args) |
| Log a message.
|
|
Sink based logging system.
Use macros to access.
Definition at line 40 of file Log.hpp.
◆ Log() [1/3]
galaxy::logging::Log::Log |
( |
| ) |
|
|
noexcept |
Constructor.
Definition at line 16 of file Log.cpp.
◆ ~Log()
galaxy::logging::Log::~Log |
( |
| ) |
|
|
noexcept |
Destructor.
Definition at line 22 of file Log.cpp.
◆ Log() [2/3]
galaxy::logging::Log::Log |
( |
const Log & | | ) |
|
|
privatedelete |
◆ Log() [3/3]
galaxy::logging::Log::Log |
( |
Log && | | ) |
|
|
privatedelete |
◆ add_sink()
template<std::derived_from<
Sink > SinkTo, typename... Args>
SinkTo & galaxy::logging::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 124 of file Log.hpp.
◆ set_min_level()
void galaxy::logging::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 132 of file Log.hpp.
◆ log()
template<
LogLevel level, typename... MsgInputs>
void galaxy::logging::Log::log |
( |
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
-
loc | Source location argument. |
message | Message template to log. |
args | std::format supported arguments to be formatted into a string. |
Definition at line 138 of file Log.hpp.
◆ operator=() [1/2]
Log & galaxy::logging::Log::operator= |
( |
const Log & | | ) |
|
|
privatedelete |
Copy assignment operator.
◆ operator=() [2/2]
Log & galaxy::logging::Log::operator= |
( |
Log && | | ) |
|
|
privatedelete |
Move assignment operator.
◆ m_min_level
LogLevel galaxy::logging::Log::m_min_level |
|
private |
Minimum level for a message to be logged.
Definition at line 115 of file Log.hpp.
◆ m_sinks
std::vector<std::unique_ptr<Sink> > galaxy::logging::Log::m_sinks |
|
private |
List of sinks.
Definition at line 120 of file Log.hpp.
The documentation for this class was generated from the following files: