duvc-ctl 2.0.0
USB Video Class Camera Control Library
Loading...
Searching...
No Matches
logging.h File Reference

Structured logging interface for duvc-ctl. More...

#include <functional>
#include <string>
Include dependency graph for logging.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  duvc
 

Macros

#define DUVC_LOG_DEBUG(msg)   duvc::log_debug(msg)
 Log debug message macro.
 
#define DUVC_LOG_INFO(msg)   duvc::log_info(msg)
 Log info message macro.
 
#define DUVC_LOG_WARNING(msg)   duvc::log_warning(msg)
 Log warning message macro.
 
#define DUVC_LOG_ERROR(msg)   duvc::log_error(msg)
 Log error message macro.
 
#define DUVC_LOG_CRITICAL(msg)   duvc::log_critical(msg)
 Log critical message macro.
 

Typedefs

using duvc::LogCallback
 Log message callback type.
 

Enumerations

enum class  duvc::LogLevel {
  duvc::Debug = 0 , duvc::Info = 1 , duvc::Warning = 2 , duvc::Error = 3 ,
  duvc::Critical = 4
}
 Log levels. More...
 

Functions

const charduvc::to_string (LogLevel level)
 Convert log level to string.
 
void duvc::set_log_callback (LogCallback callback)
 Set global log callback.
 
void duvc::set_log_level (LogLevel level)
 Set minimum log level.
 
LogLevel duvc::get_log_level ()
 Get current minimum log level.
 
void duvc::log_message (LogLevel level, const std::string &message)
 Log a message.
 
void duvc::log_debug (const std::string &message)
 Log debug message.
 
void duvc::log_info (const std::string &message)
 Log info message.
 
void duvc::log_warning (const std::string &message)
 Log warning message.
 
void duvc::log_error (const std::string &message)
 Log error message.
 
void duvc::log_critical (const std::string &message)
 Log critical message.
 

Detailed Description

Structured logging interface for duvc-ctl.

Definition in file logging.h.

Macro Definition Documentation

◆ DUVC_LOG_CRITICAL

#define DUVC_LOG_CRITICAL ( msg)    duvc::log_critical(msg)

Log critical message macro.

Parameters
msgMessage string to log at critical level

Definition at line 129 of file logging.h.

◆ DUVC_LOG_DEBUG

#define DUVC_LOG_DEBUG ( msg)    duvc::log_debug(msg)

Log debug message macro.

Parameters
msgMessage string to log at debug level

Definition at line 101 of file logging.h.

◆ DUVC_LOG_ERROR

#define DUVC_LOG_ERROR ( msg)    duvc::log_error(msg)

Log error message macro.

Parameters
msgMessage string to log at error level

Definition at line 122 of file logging.h.

◆ DUVC_LOG_INFO

#define DUVC_LOG_INFO ( msg)    duvc::log_info(msg)

Log info message macro.

Parameters
msgMessage string to log at info level

Definition at line 108 of file logging.h.

◆ DUVC_LOG_WARNING

#define DUVC_LOG_WARNING ( msg)    duvc::log_warning(msg)

Log warning message macro.

Parameters
msgMessage string to log at warning level

Definition at line 115 of file logging.h.