libcamera v0.4.0
Supporting cameras in Linux since 2019
 
Loading...
Searching...
No Matches
libcamera::Logger Class Reference

Message logger. More...

Public Member Functions

void write (const LogMessage &msg)
 Write a message to the configured logger output.
 
void backtrace ()
 Write a backtrace to the log.
 
int logSetFile (const char *path, bool color)
 Set the log file.
 
int logSetStream (std::ostream *stream, bool color)
 Set the log stream.
 
int logSetTarget (LoggingTarget target)
 Set the log target.
 
void logSetLevel (const char *category, const char *level)
 Set the log level.
 

Static Public Member Functions

static Loggerinstance ()
 Retrieve the logger instance.
 

Detailed Description

Message logger.

The Logger class handles log configuration.

Member Function Documentation

◆ instance()

Logger * libcamera::Logger::instance ( )
static

Retrieve the logger instance.

The Logger is a singleton and can't be constructed manually. This function shall instead be used to retrieve the single global instance of the logger.

Returns
The logger instance

◆ logSetFile()

int libcamera::Logger::logSetFile ( const char * path,
bool color )

Set the log file.

Parameters
[in]pathFull path to the log file
[in]colorTrue to output colored messages
See also
libcamera::logSetFile()
Returns
Zero on success, or a negative error code otherwise.

◆ logSetLevel()

void libcamera::Logger::logSetLevel ( const char * category,
const char * level )

Set the log level.

Parameters
[in]categoryLogging category
[in]levelLog level
See also
libcamera::logSetLevel()

◆ logSetStream()

int libcamera::Logger::logSetStream ( std::ostream * stream,
bool color )

Set the log stream.

Parameters
[in]streamStream to send log output to
[in]colorTrue to output colored messages
See also
libcamera::logSetStream()
Returns
Zero on success, or a negative error code otherwise.

◆ logSetTarget()

int libcamera::Logger::logSetTarget ( LoggingTarget target)

Set the log target.

Parameters
[in]targetLog destination
See also
libcamera::logSetTarget()
Returns
Zero on success, or a negative error code otherwise.

◆ write()

void libcamera::Logger::write ( const LogMessage & msg)

Write a message to the configured logger output.

Parameters
[in]msgThe message object

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