C/C++ API Reference
Loading...
Searching...
No Matches
Google Logging (glog) macros

Oveview

Warning
Pigweed strongly recommends sticking to printf-style logging instead of C++ stream-style glog logging unless absolutely necessary. These macros are only provided for compatibility with non-embedded code.

Macros

#define LOG(glog_level)
 
#define LOG_IF(glog_level, expr)
 
#define PW_LOG_CFG_GLOG_BUFFER_SIZE_BYTES   128
 

Macro Definition Documentation

◆ LOG

#define LOG (   glog_level)
Value:
_PW_LOG_GLOG(_PW_LOG_GLOG_DECLARATION_##glog_level, \
PW_CONCAT(GlogStreamingLog, __COUNTER__))

A subset of the streaming Google logging (glog) macros are supported:

The supported glog levels are DEBUG, INFO, WARNING, ERROR, FATAL, and DFATAL

This means the following are NOT supported:

  • glog level DFATAL
  • {D,P,SYS}LOG*
  • {,D}VLOG*
  • {,D}CHECK*
  • LOG_EVERY_*, LOG_IF_EVERY_*, LOG_FIRST_N

◆ LOG_IF

#define LOG_IF (   glog_level,
  expr 
)
Value:
_PW_LOG_GLOG_IF(_PW_LOG_GLOG_DECLARATION_##glog_level, \
expr, \
PW_CONCAT(GlogStreamingLog, __COUNTER__))

◆ PW_LOG_CFG_GLOG_BUFFER_SIZE_BYTES

#define PW_LOG_CFG_GLOG_BUFFER_SIZE_BYTES   128

The size of the stack-allocated buffer used by the Google Logging (glog) macros. This only affects the glog macros provided through pw_log/glog.h.

Undersizing this buffer will result in truncated log messages.