gko::log::Stream#

Writes a human-readable trace of selected events to a std::ostream. Useful during development to see allocations, kernel boundaries, and iteration progress without attaching a profiler. Configurable via event mask and verbosity.

template<typename ValueType = default_precision>
class Stream #

Inherits from

Stream is a Logger which logs every event to a stream. This can typically be used to log to a file or to the console.

Template Parameters:

ValueType – the type of values stored in the class (i.e. ValueType template parameter of the concrete Loggable this class will log)

Public Static Functions

static inline std::unique_ptr<Stream> create(
std::shared_ptr<const Executor> exec,
const Logger::mask_type &enabled_events = Logger::all_events_mask,
std::ostream &os = std::cout,
bool verbose = false,
)#

Creates a Stream logger. This dynamically allocates the memory, constructs the object and returns an std::unique_ptr to this object.

Parameters:
  • exec – the executor

  • enabled_events – the events enabled for this logger. By default all events.

  • os – the stream used for this logger

  • verbose – whether we want detailed information or not. This includes always printing residuals and other information which can give a large output.

Returns:

an std::unique_ptr to the the constructed object

static inline std::unique_ptr<Stream> create(
const Logger::mask_type &enabled_events = Logger::all_events_mask,
std::ostream &os = std::cerr,
bool verbose = false,
)#

Creates a Stream logger. This dynamically allocates the memory, constructs the object and returns an std::unique_ptr to this object.

Parameters:
  • exec – the executor

  • enabled_events – the events enabled for this logger. By default all events.

  • os – the stream used for this logger

  • verbose – whether we want detailed information or not. This includes always printing residuals and other information which can give a large output.

Returns:

an std::unique_ptr to the the constructed object