libcamera::Loggable Class Referenceabstract

Base class to support log message extensions. More...

Inheritance diagram for libcamera::Loggable:

## Protected Member Functions

virtual std::string | logPrefix () const =0
| Retrieve a string to be prefixed to the log message. More...
LogMessage | _log (const char *file, unsigned int line, LogSeverity severity) const
| Create a temporary LogMessage object to log a message. More...
LogMessage | _log (const char *file, unsigned int line, const LogCategory &category, LogSeverity severity) const
| Create a temporary LogMessage object to log a message. More...

## Detailed Description

Base class to support log message extensions.

The Loggable class allows classes to extend log messages without any change to the way the LOG() macro is invoked. By inheriting from Loggable and implementing the logPrefix() virtual method, a class can specify extra information to be automatically added to messages logged from class member methods.

## Member Function Documentation

## _log() [1/2]

LogMessage libcamera::Loggable::_log | ( | const char * | fileName,
|  | unsigned int | line,
|  | const LogCategory & | category,
|  | LogSeverity | severity
| ) |  | const

protected

Create a temporary LogMessage object to log a message.

Parameters

  [in] | fileName | The file name where the message is logged from
  [in] | line | The line number where the message is logged from
  [in] | category | The log message category
  [in] | severity | The log message severity

This method is used as a backeng by the LOG() macro to create a log message for locations inheriting from the Loggable class.

Returns
  A log message

## _log() [2/2]

LogMessage libcamera::Loggable::_log | ( | const char * | fileName,
|  | unsigned int | line,
|  | LogSeverity | severity
| ) |  | const

protected

Create a temporary LogMessage object to log a message.

Parameters

  [in] | fileName | The file name where the message is logged from
  [in] | line | The line number where the message is logged from
  [in] | severity | The log message severity

This method is used as a backeng by the LOG() macro to create a log message for locations inheriting from the Loggable class.

Returns
  A log message

## logPrefix()

libcamera::Loggable::logPrefix | ( |  | ) | const

protected pure virtual

Retrieve a string to be prefixed to the log message.

This method allows classes inheriting from the Loggable class to extend the logger with an object-specific prefix output right before the log message contents.

Returns
  A string to be prefixed to the log message

Implemented in libcamera::V4L2VideoDevice, libcamera::V4L2Subdevice, libcamera::MediaDevice, libcamera::IPAModule, and libcamera::CameraSensor.

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

- include/libcamera/internal/log.h
- src/libcamera/log.cpp