OGLplus  (0.59.0) a C++ wrapper for rendering APIs

eagine::logger_backend Struct Referenceabstract

Interface for logging backend implementations. More...

#include <eagine/logging/backend.hpp>

Public Member Functions

virtual auto allocator () noexcept -> memory::shared_byte_allocator=0
 The memory allocator used by the logger backend.
 
virtual auto type_id () noexcept -> identifier=0
 The backend type identifier.
 
virtual auto entry_backend (identifier source, log_event_severity severity) noexcept -> logger_backend *=0
 Returns a pointer to the actual backend to be used by an log_entry. More...
 
virtual void enter_scope (identifier scope) noexcept=0
 Enters logging scope.
 
virtual void leave_scope (identifier scope) noexcept=0
 Leaves logging scope.
 
virtual void set_description (identifier source, logger_instance_id instance, string_view display_name, string_view description) noexcept=0
 Sets the user-readable description for the logger object.
 
virtual auto begin_message (identifier source, identifier tag, logger_instance_id instance, log_event_severity severity, string_view format) noexcept -> bool=0
 Begins a new logging message. More...
 
virtual void add_nothing (identifier arg, identifier tag) noexcept=0
 Add valueless (name-only) argument. More...
 
virtual void add_identifier (identifier arg, identifier tag, identifier value) noexcept=0
 Add argument with identifier value. More...
 
virtual void add_bool (identifier arg, identifier tag, bool value) noexcept=0
 Add argument with boolean value. More...
 
virtual void add_integer (identifier arg, identifier tag, std::intmax_t value) noexcept=0
 Add argument with signed integer value. More...
 
virtual void add_unsigned (identifier arg, identifier tag, std::uintmax_t value) noexcept=0
 Add argument with unsigned integer value. More...
 
virtual void add_float (identifier arg, identifier tag, float value) noexcept=0
 Add argument with floating-point value. More...
 
virtual void add_float (identifier arg, identifier tag, float min, float value, float max) noexcept=0
 Add argument with floating-point value with minimum and maximum. More...
 
virtual void add_duration (identifier arg, identifier tag, std::chrono::duration< float > value) noexcept=0
 Add argument with time duration value. More...
 
virtual void add_string (identifier arg, identifier tag, string_view value) noexcept=0
 Add argument with string value. More...
 
virtual void add_blob (identifier arg, identifier tag, memory::const_block value) noexcept=0
 Add argument with BLOB value. More...
 
template<typename T >
auto add_adapted (identifier arg, const T &value) -> std::enable_if_t< has_log_entry_adapter_v< T >>
 Add argument with value having type adaptable to log entry. More...
 
virtual void finish_message () noexcept=0
 Finishes the current logging message.
 
virtual void finish_log () noexcept=0
 Finishes the current log.
 
virtual void log_chart_sample (identifier source, logger_instance_id instance, identifier series, float value) noexcept=0
 Adds a chart/graph sample to the log. More...
 
- Public Member Functions inherited from eagine::interface< logger_backend >
constexpr interface (const interface &)=delete
 Not copyable.
 
auto operator= (interface &&)=delete
 Not move assignable.
 
auto operator= (const interface &)=delete
 Not copy assignable.
 

Additional Inherited Members

- Protected Member Functions inherited from eagine::interface< logger_backend >
constexpr interface () noexcept=default
 Default constructible by derived.
 
constexpr interface (interface &&) noexcept=default
 Move constructible by derived.
 

Detailed Description

Interface for logging backend implementations.

Member Function Documentation

◆ add_adapted()

template<typename T >
auto eagine::logger_backend::add_adapted ( identifier  arg,
const T &  value 
) -> std::enable_if_t<has_log_entry_adapter_v<T>>
inline

Add argument with value having type adaptable to log entry.

Parameters
argthe argument name identifier.
tagthe argument type identifier.
valuethe value of the argument.
See also
has_log_entry_adapter_v

◆ add_blob()

virtual void eagine::logger_backend::add_blob ( identifier  arg,
identifier  tag,
memory::const_block  value 
)
pure virtualnoexcept

Add argument with BLOB value.

Parameters
argthe argument name identifier.
tagthe argument type identifier.
valuethe value of the argument.

Referenced by eagine::log_entry::arg().

◆ add_bool()

virtual void eagine::logger_backend::add_bool ( identifier  arg,
identifier  tag,
bool  value 
)
pure virtualnoexcept

Add argument with boolean value.

Parameters
argthe argument name identifier.
tagthe argument type identifier.
valuethe value of the argument.

◆ add_duration()

virtual void eagine::logger_backend::add_duration ( identifier  arg,
identifier  tag,
std::chrono::duration< float >  value 
)
pure virtualnoexcept

Add argument with time duration value.

Parameters
argthe argument name identifier.
tagthe argument type identifier.
valuethe value of the argument.

Referenced by eagine::log_entry::arg().

◆ add_float() [1/2]

virtual void eagine::logger_backend::add_float ( identifier  arg,
identifier  tag,
float  min,
float  value,
float  max 
)
pure virtualnoexcept

Add argument with floating-point value with minimum and maximum.

Parameters
argthe argument name identifier.
tagthe argument type identifier.
valuethe value of the argument.
minthe minimum limit for the value.
maxthe maximum limit for the value.

◆ add_float() [2/2]

virtual void eagine::logger_backend::add_float ( identifier  arg,
identifier  tag,
float  value 
)
pure virtualnoexcept

Add argument with floating-point value.

Parameters
argthe argument name identifier.
tagthe argument type identifier.
valuethe value of the argument.

Referenced by eagine::log_entry::arg().

◆ add_identifier()

virtual void eagine::logger_backend::add_identifier ( identifier  arg,
identifier  tag,
identifier  value 
)
pure virtualnoexcept

Add argument with identifier value.

Parameters
argthe argument name identifier.
tagthe argument type identifier.
valuethe value of the argument.

Referenced by eagine::log_entry::arg().

◆ add_integer()

virtual void eagine::logger_backend::add_integer ( identifier  arg,
identifier  tag,
std::intmax_t  value 
)
pure virtualnoexcept

Add argument with signed integer value.

Parameters
argthe argument name identifier.
tagthe argument type identifier.
valuethe value of the argument.

Referenced by eagine::log_entry::arg().

◆ add_nothing()

virtual void eagine::logger_backend::add_nothing ( identifier  arg,
identifier  tag 
)
pure virtualnoexcept

Add valueless (name-only) argument.

Parameters
argthe argument name identifier.
tagthe argument type identifier.
valuethe value of the argument.

◆ add_string()

virtual void eagine::logger_backend::add_string ( identifier  arg,
identifier  tag,
string_view  value 
)
pure virtualnoexcept

Add argument with string value.

Parameters
argthe argument name identifier.
tagthe argument type identifier.
valuethe value of the argument.

Referenced by eagine::log_entry::arg().

◆ add_unsigned()

virtual void eagine::logger_backend::add_unsigned ( identifier  arg,
identifier  tag,
std::uintmax_t  value 
)
pure virtualnoexcept

Add argument with unsigned integer value.

Parameters
argthe argument name identifier.
tagthe argument type identifier.
valuethe value of the argument.

Referenced by eagine::log_entry::arg().

◆ begin_message()

virtual auto eagine::logger_backend::begin_message ( identifier  source,
identifier  tag,
logger_instance_id  instance,
log_event_severity  severity,
string_view  format 
) -> bool
pure virtualnoexcept

Begins a new logging message.

Parameters
sourcethe identifier of the source logger object.
tagthe identifier of this message type or instance.
instanceunique instance id of the source logger object.
severitythe log level or severity of the log event.
formatthe format string of the message. May contain argument placeholders.

◆ entry_backend()

virtual auto eagine::logger_backend::entry_backend ( identifier  source,
log_event_severity  severity 
) -> logger_backend *
pure virtualnoexcept

Returns a pointer to the actual backend to be used by an log_entry.

Parameters
sourcethe identifier of the source logger object.
severitythe log level or severity of the log event.

◆ log_chart_sample()

virtual void eagine::logger_backend::log_chart_sample ( identifier  source,
logger_instance_id  instance,
identifier  series,
float  value 
)
pure virtualnoexcept

Adds a chart/graph sample to the log.

Parameters
sourcethe identifier of the source logger object.
instanceunique instance id of the source logger object.
seriesthe identifier of the chart data series.
valuethe sample value.

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

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).