gko::log::EnableLogging#
CRTP convenience that combines Loggable with the type-erased dispatch
used internally. Most users will not derive from this directly — every
Ginkgo LinOp already inherits it transitively.
-
template<typename ConcreteLoggable, typename PolymorphicBase = Loggable>
class EnableLogging # Inherits from
public gko::log::Loggable
EnableLogging is a mixin which should be inherited by any class which wants to enable logging. All the received events are passed to the loggers this class contains.
- Template Parameters:
Public Functions
- std::shared_ptr<const Logger> logger,
Adds a new logger to the list of subscribed loggers.
- Parameters:
logger – the logger to add
-
inline virtual void remove_logger(const Logger *logger) override#
Removes a logger from the list of subscribed loggers.
Note
The comparison is done using the logger’s object unique identity. Thus, two loggers constructed in the same way are not considered equal.
- Parameters:
logger – the logger to remove
- inline virtual const std::vector<std::shared_ptr<const Logger>> &get_loggers(
Returns the vector containing all loggers registered at this object.
- Returns:
the vector containing all registered loggers.
-
inline virtual void clear_loggers() override#
Remove all loggers registered at this object.