Public Member Functions | Protected Attributes | List of all members
cras::HasLogger Class Reference

Convenience base class for providing this->log and getCrasLogger(). Just add it as a base to your class and all CRAS_* logging macros should work with the logger from this class. More...

#include <log_utils.h>

Inheritance diagram for cras::HasLogger:
Inheritance graph
[legend]

Public Member Functions

::cras::LogHelperConstPtr getCrasLogger () const
 This is the function picked up by CRAS_* logging macros. More...
 
 HasLogger (const ::cras::LogHelperPtr &log)
 Associate the logger with this interface. More...
 
void setCrasLogger (const ::cras::LogHelperPtr &log)
 Set the logger to be used for logging. More...
 

Protected Attributes

::cras::LogHelperPtr log
 Log helper. More...
 

Detailed Description

Convenience base class for providing this->log and getCrasLogger(). Just add it as a base to your class and all CRAS_* logging macros should work with the logger from this class.

Definition at line 229 of file log_utils.h.

Constructor & Destructor Documentation

◆ HasLogger()

cras::HasLogger::HasLogger ( const ::cras::LogHelperPtr log)
explicit

Associate the logger with this interface.

Parameters
[in]logThe logger to use.

Member Function Documentation

◆ getCrasLogger()

::cras::LogHelperConstPtr cras::HasLogger::getCrasLogger ( ) const

This is the function picked up by CRAS_* logging macros.

Returns
The internal logger.

◆ setCrasLogger()

void cras::HasLogger::setCrasLogger ( const ::cras::LogHelperPtr log)

Set the logger to be used for logging.

Parameters
[in]logThe logger to be used.

Member Data Documentation

◆ log

::cras::LogHelperPtr cras::HasLogger::log
protected

Log helper.

Definition at line 252 of file log_utils.h.


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


cras_cpp_common
Author(s): Martin Pecka
autogenerated on Sat Mar 2 2024 03:47:35