ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::Logging::OutputDecorator Class Reference

base class for decorating the debug output More...

#include <Acts/Utilities/Logger.hpp>

Inheritance diagram for Acts::Logging::OutputDecorator:
[legend]
Collaboration diagram for Acts::Logging::OutputDecorator:
[legend]

Public Member Functions

 OutputDecorator (std::unique_ptr< OutputPrintPolicy > wrappee)
 constructor wrapping actual output print policy
void flush (const Level &lvl, const std::string &input) override
 flush the debug message to the destination stream
const std::string & name () const override
 Return the name of the output decorator (forwards to wrappee).
Public Member Functions inherited from Acts::Logging::OutputPrintPolicy
virtual ~OutputPrintPolicy ()=default
 virtual default destructor
virtual std::unique_ptr< OutputPrintPolicyclone (const std::string &name) const =0
 Make a copy of this print policy with a new name.

Protected Attributes

std::unique_ptr< OutputPrintPolicym_wrappee
 wrapped object for printing the debug message

Detailed Description

base class for decorating the debug output

Derived classes may augment the debug message with additional information. Chaining different decorators is possible to customize the output to your needs.

Constructor & Destructor Documentation

◆ OutputDecorator()

Acts::Logging::OutputDecorator::OutputDecorator ( std::unique_ptr< OutputPrintPolicy > wrappee)
explicit

constructor wrapping actual output print policy

Parameters
[in]wrappeeoutput print policy object which is wrapped by this decorator object

Member Function Documentation

◆ flush()

void Acts::Logging::OutputDecorator::flush ( const Level & lvl,
const std::string & input )
overridevirtual

flush the debug message to the destination stream

Parameters
[in]lvldebug level of debug message
[in]inputtext of debug message

This function delegates the flushing of the debug message to its wrapped object.

Implements Acts::Logging::OutputPrintPolicy.

Reimplemented in Acts::Logging::ThreadOutputDecorator, and Acts::Logging::TimedOutputDecorator.

◆ name()

const std::string & Acts::Logging::OutputDecorator::name ( ) const
overridevirtual

Return the name of the output decorator (forwards to wrappee).

Returns
the name

Implements Acts::Logging::OutputPrintPolicy.

Member Data Documentation

◆ m_wrappee

std::unique_ptr<OutputPrintPolicy> Acts::Logging::OutputDecorator::m_wrappee
protected

wrapped object for printing the debug message