Ginkgo: gko::log::EnableLogging< ConcreteLoggable, PolymorphicBase > Class Template Reference

| Ginkgo Generated from branch based on main. Ginkgo version 1.11.0 A numerical linear algebra library targeting many-core architectures

Loading...
Searching...
No Matches
gko::log::EnableLogging< ConcreteLoggable, PolymorphicBase > Class Template Reference

EnableLogging is a mixin which should be inherited by any class which wants to enable logging. More...

`#include <ginkgo/core/log/logger.hpp>`

Inheritance diagram for gko::log::EnableLogging< ConcreteLoggable, PolymorphicBase >:
[legend]
Collaboration diagram for gko::log::EnableLogging< ConcreteLoggable, PolymorphicBase >:
[legend]

## Public Member Functions
void | add_logger (std::shared_ptr< const Logger > logger) override
| Adds a new logger to the list of subscribed loggers.
void | remove_logger (const Logger *logger) override
| Removes a logger from the list of subscribed loggers.
void | remove_logger (ptr_param< const Logger > logger)
const std::vector< std::shared_ptr< const Logger > > & | get_loggers () const override
| Returns the vector containing all loggers registered at this object.
void | clear_loggers () override
| Remove all loggers registered at this object.
Public Member Functions inherited from gko::log::Loggable
void | remove_logger (ptr_param< const Logger > logger)

## Detailed Description

template<typename ConcreteLoggable, typename PolymorphicBase = Loggable>
class gko::log::EnableLogging< ConcreteLoggable, PolymorphicBase >

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

  ConcreteLoggable | the object being logged [CRTP parameter]
  PolymorphicBase | the polymorphic base of this class. By default it is Loggable. Change it if you want to use a new superclass of Loggable as polymorphic base of this class.

## Member Function Documentation

## ◆ add_logger()

template<typename ConcreteLoggable, typename PolymorphicBase = Loggable>

void gko::log::EnableLogging< ConcreteLoggable, PolymorphicBase >::add_logger | ( | std::shared_ptr< const Logger > | logger | ) |
| inlineoverridevirtual

Adds a new logger to the list of subscribed loggers.

Parameters

  logger | the logger to add

Implements gko::log::Loggable.

Reimplemented in gko::Executor.

## ◆ clear_loggers()

template<typename ConcreteLoggable, typename PolymorphicBase = Loggable>

void gko::log::EnableLogging< ConcreteLoggable, PolymorphicBase >::clear_loggers | ( |  | ) |
| inlineoverridevirtual

Remove all loggers registered at this object.

Implements gko::log::Loggable.

## ◆ get_loggers()

template<typename ConcreteLoggable, typename PolymorphicBase = Loggable>

const std::vector< std::shared_ptr< const Logger > > & gko::log::EnableLogging< ConcreteLoggable, PolymorphicBase >::get_loggers | ( |  | ) | const
| inlineoverridevirtual

Returns the vector containing all loggers registered at this object.

Returns
  the vector containing all registered loggers.

Implements gko::log::Loggable.

## ◆ remove_logger()

template<typename ConcreteLoggable, typename PolymorphicBase = Loggable>

void gko::log::EnableLogging< ConcreteLoggable, PolymorphicBase >::remove_logger | ( | const Logger * | logger | ) |
| inlineoverridevirtual

Removes a logger from the list of subscribed loggers.

Parameters

  logger | the logger to remove

Note
  The comparison is done using the logger's object unique identity. Thus, two loggers constructed in the same way are not considered equal.

Implements gko::log::Loggable.

Reimplemented in gko::Executor.

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

- ginkgo/core/log/logger.hpp