Skip to main content
Pigweed's logo Pigweed
code_xml
  1. Home
  2. Reference
  3. C/C++
  4. Observability
  5. pw_log
  6. Global config
Global config

Overview

These configuration options differ from the options in pw_log/options.h in that these should be set at a global level in the build system rather than at a module or compile unit level.

Macros

#define PW_LOG_LEVEL_DEFAULT   PW_LOG_LEVEL_INFO
 User-provided header to optionally override options in this file.
 
#define PW_LOG_FLAGS_DEFAULT   0
 
#define PW_LOG_ENABLE_IF(level, verbosity, module, flags)    ((int32_t)(level) >= (int32_t)(verbosity))
 
#define PW_LOG_STATUS_STRING_SIZE   128
 

Macro Definition Documentation

◆ PW_LOG_ENABLE_IF

#define PW_LOG_ENABLE_IF (   level,
  verbosity,
  module,
  flags 
)     ((int32_t)(level) >= (int32_t)(verbosity))

PW_LOG_ENABLE_IF controls which logs are enabled.

This expression determines whether or not the statement is enabled and should be passed to the backend. It is evaluated at the log call site.

◆ PW_LOG_FLAGS_DEFAULT

#define PW_LOG_FLAGS_DEFAULT   0

PW_LOG_FLAGS_DEFAULT controls the default value of PW_LOG_FLAGS.

For log statements like LOG_INFO that don't have an explicit argument, this is used for the flags value.

◆ PW_LOG_LEVEL_DEFAULT

#define PW_LOG_LEVEL_DEFAULT   PW_LOG_LEVEL_INFO

User-provided header to optionally override options in this file.

PW_LOG_LEVEL_DEFAULT controls the default value of PW_LOG_LEVEL.

Defaults to PW_LOG_LEVEL_INFO.

◆ PW_LOG_STATUS_STRING_SIZE

#define PW_LOG_STATUS_STRING_SIZE   128

Size in bytes of the buffer that PW_LOG_STATUS formats a status into for non-tokenizing pw_log backends when status messages are enabled. Text that does not fit, including the null terminator, is truncated.