libdisplaydevice latest
C++ library to modify display devices.
logging.h File Reference

Declarations for the logging utility. More...

#include <functional>
#include <sstream>
#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.

Classes

class  display_device::Logger
 A singleton class for logging or re-routing logs. More...
 
class  display_device::LogWriter
 A helper class for accumulating output via the stream operator and then writing it out at once. More...
 

Macros

#define DD_LOG(level)
 Helper MACRO that disables output string computation if log level is not enabled.
 

Detailed Description

Declarations for the logging utility.

Macro Definition Documentation

◆ DD_LOG

#define DD_LOG ( level)
Value:
for (bool is_enabled {display_device::Logger::get().isLogLevelEnabled(display_device::Logger::LogLevel::level)}; is_enabled; is_enabled = false) \
display_device::LogWriter(display_device::Logger::LogLevel::level)
A helper class for accumulating output via the stream operator and then writing it out at once.
Definition logging.h:116
static Logger & get()
Get the singleton instance.
Definition logging.cpp:34
bool isLogLevelEnabled(LogLevel log_level) const
Check if log level is currently enabled.
Definition logging.cpp:43

Helper MACRO that disables output string computation if log level is not enabled.

*Examples**

DD_LOG(info) << "Hello World!" << " " << 123;
DD_LOG(error) << "OH MY GAWD!";
#define DD_LOG(level)
Helper MACRO that disables output string computation if log level is not enabled.
Definition logging.h:153