ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::Logging::NamedOutputDecorator Class Referencefinal

decorate debug message with a name More...

#include <Acts/Utilities/Logger.hpp>

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

Public Member Functions

 NamedOutputDecorator (std::unique_ptr< OutputPrintPolicy > wrappee, const std::string &name, unsigned int maxWidth=15)
 constructor
std::unique_ptr< OutputPrintPolicyclone (const std::string &name) const override
 Make a copy of this print policy with a new name.
void flush (const Level &lvl, const std::string &input) override
 flush the debug message to the destination stream
const std::string & name () const override
 Get this named output decorators name.
Public Member Functions inherited from Acts::Logging::OutputDecorator
 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

Additional Inherited Members

Protected Attributes inherited from Acts::Logging::OutputDecorator
std::unique_ptr< OutputPrintPolicym_wrappee
 wrapped object for printing the debug message

Detailed Description

decorate debug message with a name

The debug message is complemented with a name.

Constructor & Destructor Documentation

◆ NamedOutputDecorator()

Acts::Logging::NamedOutputDecorator::NamedOutputDecorator ( std::unique_ptr< OutputPrintPolicy > wrappee,
const std::string & name,
unsigned int maxWidth = 15 )

constructor

Parameters
[in]wrappeeoutput print policy object to be wrapped
[in]namename to be added to debug message
[in]maxWidthmaximum width of field used for name

Member Function Documentation

◆ clone()

std::unique_ptr< OutputPrintPolicy > Acts::Logging::NamedOutputDecorator::clone ( const std::string & name) const
overridevirtual

Make a copy of this print policy with a new name.

Parameters
namethe new name
Returns
the copy

Implements Acts::Logging::OutputPrintPolicy.

◆ flush()

void Acts::Logging::NamedOutputDecorator::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 prepends the given name to the debug message and then delegates the flushing of the whole message to its wrapped object.

Implements Acts::Logging::OutputPrintPolicy.

◆ name()

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

Get this named output decorators name.

Returns
the name

Implements Acts::Logging::OutputPrintPolicy.