vdr-plugin-drmdevice 2.0.0-46418f1
cLogger Class Reference

Logger. More...

#include <logger.h>

Public Member Functions

void LogFatal (const char *format,...)
 Log to syslog LOG_ERR and abort.
 
void LogError (const char *format,...)
 Log to syslog LOG_ERR.
 
void LogWarning (const char *format,...)
 Log to syslog LOG_WARNING.
 
void LogInfo (const char *format,...)
 Log to syslog LOG_INFO.
 
void LogDebug (const char *format,...)
 Log to syslog LOG_DEBUG.
 
void LogDebug2 (const int cat, const char *format,...)
 Log to syslog LOG_DEBUG and add logging category to output.
 
void LogFFmpeg (const char *, va_list)
 Log to syslog LOG_DEBUG and add prefix [FFMpeg] to output.
 
void SetLogLevel (int level)
 
int GetLogLevel (void)
 
void SetChannelSwitchStartTime (std::chrono::steady_clock::time_point time)
 
void SetChannelSwitchDataReceivedTime (std::chrono::steady_clock::time_point time)
 
std::chrono::steady_clock::time_point GetChannelSwitchStartTime (void)
 
std::chrono::steady_clock::time_point GetChannelSwitchDataReceivedTime (void)
 

Static Public Member Functions

static std::shared_ptr< cLogger > GetLogger ()
 Get an instance to the global logger.
 
static void LogFFmpegCallback (void *, int, const char *, va_list)
 Callback for ffmpeg logs.
 

Private Member Functions

 cLogger (void)=default
 
 cLogger (const cLogger &)=delete
 
cLogger & operator= (const cLogger &)=delete
 

Private Attributes

std::chrono::steady_clock::time_point m_channelSwitchStartTime
 timestamp, when VDR triggered a channel switch
 
std::chrono::steady_clock::time_point m_dataReceivedTime
 timestamp, when the first audio or video data after a channel switch arrives in Play*()
 
std::atomic< int > m_logLevel = 0
 loglevel mask (see enum LogFlags)
 

Static Private Attributes

static constexpr int MAX_LOGMESSAGE_SIZE = 512
 max size of the log message
 

Detailed Description

Logger.

Plugin specific logging implementation which does not depend on VDR loglevels

Definition at line 86 of file logger.h.

Constructor & Destructor Documentation

◆ cLogger() [1/2]

cLogger::cLogger ( void  )
privatedefault

Referenced by GetLogger().

◆ cLogger() [2/2]

cLogger::cLogger ( const cLogger &  )
privatedelete

Member Function Documentation

◆ GetChannelSwitchDataReceivedTime()

std::chrono::steady_clock::time_point cLogger::GetChannelSwitchDataReceivedTime ( void  )
inline

Definition at line 104 of file logger.h.

References m_dataReceivedTime.

◆ GetChannelSwitchStartTime()

std::chrono::steady_clock::time_point cLogger::GetChannelSwitchStartTime ( void  )
inline

Definition at line 103 of file logger.h.

References m_channelSwitchStartTime.

◆ GetLogger()

std::shared_ptr< cLogger > cLogger::GetLogger ( )
static

Get an instance to the global logger.

Returns
pointer to the logger instance

Definition at line 43 of file logger.cpp.

References cLogger().

Referenced by LogFFmpegCallback(), and cDeviceConfig::SetupParse().

◆ GetLogLevel()

int cLogger::GetLogLevel ( void  )
inline

Definition at line 99 of file logger.h.

References m_logLevel.

◆ LogDebug()

void cLogger::LogDebug ( const char *  format,
  ... 
)

Log to syslog LOG_DEBUG.

Definition at line 130 of file logger.cpp.

References m_logLevel, and MAX_LOGMESSAGE_SIZE.

◆ LogDebug2()

void cLogger::LogDebug2 ( const int  cat,
const char *  format,
  ... 
)

Log to syslog LOG_DEBUG and add logging category to output.

Definition at line 149 of file logger.cpp.

References L_AV_SYNC, L_CODEC, L_DEBUG, L_DRM, L_GRAB, L_MEDIA, L_OPENGL, L_OPENGL_TIME, L_OPENGL_TIME_ALL, L_OSD, L_PACKET, L_SOUND, L_STILL, L_TRICK, m_logLevel, and MAX_LOGMESSAGE_SIZE.

◆ LogError()

void cLogger::LogError ( const char *  format,
  ... 
)

Log to syslog LOG_ERR.

Definition at line 73 of file logger.cpp.

References MAX_LOGMESSAGE_SIZE, and SysLogLevel.

◆ LogFatal()

void cLogger::LogFatal ( const char *  format,
  ... 
)

Log to syslog LOG_ERR and abort.

Definition at line 52 of file logger.cpp.

References MAX_LOGMESSAGE_SIZE, and SysLogLevel.

◆ LogFFmpeg()

void cLogger::LogFFmpeg ( const char *  fmt,
va_list  vl 
)

Log to syslog LOG_DEBUG and add prefix [FFMpeg] to output.

Definition at line 209 of file logger.cpp.

References AV_LOGLEVEL, L_FFMPEG, m_logLevel, and MAX_LOGMESSAGE_SIZE.

◆ LogFFmpegCallback()

void cLogger::LogFFmpegCallback ( void *  ptr,
int  level,
const char *  fmt,
va_list  vl 
)
static

Callback for ffmpeg logs.

Log to LOG_DEBUG and add prefix to output

Definition at line 231 of file logger.cpp.

References GetLogger().

Referenced by cVideoDecoder::cVideoDecoder().

◆ LogInfo()

void cLogger::LogInfo ( const char *  format,
  ... 
)

Log to syslog LOG_INFO.

Definition at line 111 of file logger.cpp.

References MAX_LOGMESSAGE_SIZE, and SysLogLevel.

◆ LogWarning()

void cLogger::LogWarning ( const char *  format,
  ... 
)

Log to syslog LOG_WARNING.

Definition at line 92 of file logger.cpp.

References MAX_LOGMESSAGE_SIZE, and SysLogLevel.

◆ operator=()

cLogger & cLogger::operator= ( const cLogger &  )
privatedelete

◆ SetChannelSwitchDataReceivedTime()

void cLogger::SetChannelSwitchDataReceivedTime ( std::chrono::steady_clock::time_point  time)
inline

Definition at line 102 of file logger.h.

References m_dataReceivedTime.

◆ SetChannelSwitchStartTime()

void cLogger::SetChannelSwitchStartTime ( std::chrono::steady_clock::time_point  time)
inline

Definition at line 101 of file logger.h.

References m_channelSwitchStartTime.

◆ SetLogLevel()

void cLogger::SetLogLevel ( int  level)
inline

Definition at line 98 of file logger.h.

References m_logLevel.

Member Data Documentation

◆ m_channelSwitchStartTime

std::chrono::steady_clock::time_point cLogger::m_channelSwitchStartTime
private

timestamp, when VDR triggered a channel switch

Definition at line 113 of file logger.h.

Referenced by GetChannelSwitchStartTime(), and SetChannelSwitchStartTime().

◆ m_dataReceivedTime

std::chrono::steady_clock::time_point cLogger::m_dataReceivedTime
private

timestamp, when the first audio or video data after a channel switch arrives in Play*()

Definition at line 114 of file logger.h.

Referenced by GetChannelSwitchDataReceivedTime(), and SetChannelSwitchDataReceivedTime().

◆ m_logLevel

std::atomic<int> cLogger::m_logLevel = 0
private

loglevel mask (see enum LogFlags)

Definition at line 116 of file logger.h.

Referenced by GetLogLevel(), LogDebug(), LogDebug2(), LogFFmpeg(), and SetLogLevel().

◆ MAX_LOGMESSAGE_SIZE

constexpr int cLogger::MAX_LOGMESSAGE_SIZE = 512
staticconstexprprivate

max size of the log message

Definition at line 111 of file logger.h.

Referenced by LogDebug(), LogDebug2(), LogError(), LogFatal(), LogFFmpeg(), LogInfo(), and LogWarning().


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