HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
macros.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CREATE_MESSAGE(logger, severity, category, datatype)   ::onnxruntime::logging::Capture(logger, ::onnxruntime::logging::Severity::k##severity, category, datatype, ORT_WHERE)
 
#define LOGS_CATEGORY(logger, severity, category)
 
#define LOGS_USER_CATEGORY(logger, severity, category)
 
#define LOGF_CATEGORY(logger, severity, category, format_str,...)
 
#define LOGF_USER_CATEGORY(logger, severity, category, format_str,...)
 
#define LOGS(logger, severity)   LOGS_CATEGORY(logger, severity, ::onnxruntime::logging::Category::onnxruntime)
 
#define LOGS_USER(logger, severity)   LOGS_USER_CATEGORY(logger, severity, ::onnxruntime::logging::Category::onnxruntime)
 
#define LOGF(logger, severity, format_str,...)   LOGF_CATEGORY(logger, severity, ::onnxruntime::logging::Category::onnxruntime, format_str, ##__VA_ARGS__)
 
#define LOGF_USER(logger, severity, format_str,...)   LOGF_USER_CATEGORY(logger, severity, ::onnxruntime::logging::Category::onnxruntime, format_str, ##__VA_ARGS__)
 
#define LOGS_DEFAULT_CATEGORY(severity, category)   LOGS_CATEGORY(::onnxruntime::logging::LoggingManager::DefaultLogger(), severity, category)
 
#define LOGS_USER_DEFAULT_CATEGORY(severity, category)   LOGS_USER_CATEGORY(::onnxruntime::logging::LoggingManager::DefaultLogger(), severity, category)
 
#define LOGF_DEFAULT_CATEGORY(severity, category, format_str,...)   LOGF_CATEGORY(::onnxruntime::logging::LoggingManager::DefaultLogger(), severity, category, format_str, ##__VA_ARGS__)
 
#define LOGF_USER_DEFAULT_CATEGORY(severity, category, format_str,...)   LOGF_USER_CATEGORY(::onnxruntime::logging::LoggingManager::DefaultLogger(), severity, category, format_str, ##__VA_ARGS__)
 
#define LOGS_DEFAULT(severity)   LOGS_DEFAULT_CATEGORY(severity, ::onnxruntime::logging::Category::onnxruntime)
 
#define LOGS_USER_DEFAULT(severity)   LOGS_USER_DEFAULT_CATEGORY(severity, ::onnxruntime::logging::Category::onnxruntime)
 
#define LOGF_DEFAULT(severity, format_str,...)   LOGF_DEFAULT_CATEGORY(severity, ::onnxruntime::logging::Category::onnxruntime, format_str, ##__VA_ARGS__)
 
#define LOGF_USER_DEFAULT(severity, format_str,...)   LOGF_USER_DEFAULT_CATEGORY(severity, ::onnxruntime::logging::Category::onnxruntime, format_str, ##__VA_ARGS__)
 
#define LOGS_CATEGORY_IF(boolean_expression, logger, severity, category)
 
#define LOGS_DEFAULT_CATEGORY_IF(boolean_expression, severity, category)
 
#define LOGS_USER_CATEGORY_IF(boolean_expression, logger, severity, category)
 
#define LOGS_USER_DEFAULT_CATEGORY_IF(boolean_expression, severity, category)
 
#define LOGF_CATEGORY_IF(boolean_expression, logger, severity, category, format_str,...)
 
#define LOGF_DEFAULT_CATEGORY_IF(boolean_expression, severity, category, format_str,...)
 
#define LOGF_USER_CATEGORY_IF(boolean_expression, logger, severity, category, format_str,...)
 
#define LOGF_USER_DEFAULT_CATEGORY_IF(boolean_expression, severity, category, format_str,...)
 
#define LOGS_IF(boolean_expression, logger, severity)   LOGS_CATEGORY_IF(boolean_expression, logger, severity, ::onnxruntime::logging::Category::onnxruntime)
 
#define LOGS_DEFAULT_IF(boolean_expression, severity)   LOGS_DEFAULT_CATEGORY_IF(boolean_expression, severity, ::onnxruntime::logging::Category::onnxruntime)
 
#define LOGS_USER_IF(boolean_expression, logger, severity)   LOGS_USER_CATEGORY_IF(boolean_expression, logger, severity, ::onnxruntime::logging::Category::onnxruntime)
 
#define LOGS_USER_DEFAULT_IF(boolean_expression, severity)   LOGS_USER_DEFAULT_CATEGORY_IF(boolean_expression, severity, ::onnxruntime::logging::Category::onnxruntime)
 
#define LOGF_IF(boolean_expression, logger, severity, format_str,...)   LOGF_CATEGORY_IF(boolean_expression, logger, severity, ::onnxruntime::logging::Category::onnxruntime, format_str, ##__VA_ARGS__)
 
#define LOGF_DEFAULT_IF(boolean_expression, severity, format_str,...)   LOGF_DEFAULT_CATEGORY_IF(boolean_expression, severity, ::onnxruntime::logging::Category::onnxruntime, format_str, ##__VA_ARGS__)
 
#define LOGF_USER_IF(boolean_expression, logger, severity, format_str,...)
 
#define LOGF_USER_DEFAULT_IF(boolean_expression, severity, format_str,...)
 
#define VLOGS(logger, level)
 
#define VLOGS_USER(logger, level)
 
#define VLOGF(logger, level, format_str,...)
 
#define VLOGF_USER(logger, level, format_str,...)
 
#define VLOGS_DEFAULT(level)   VLOGS(::onnxruntime::logging::LoggingManager::DefaultLogger(), level)
 
#define VLOGS_USER_DEFAULT(level)   VLOGS_USER(::onnxruntime::logging::LoggingManager::DefaultLogger(), level)
 
#define VLOGF_DEFAULT(level, format_str,...)   VLOGF(::onnxruntime::logging::LoggingManager::DefaultLogger(), level, format_str, ##__VA_ARGS__)
 
#define VLOGF_USER_DEFAULT(level, format_str,...)   VLOGF_USER(::onnxruntime::logging::LoggingManager::DefaultLogger(), level, format_str, ##__VA_ARGS__)
 

Macro Definition Documentation

#define CREATE_MESSAGE (   logger,
  severity,
  category,
  datatype 
)    ::onnxruntime::logging::Capture(logger, ::onnxruntime::logging::Severity::k##severity, category, datatype, ORT_WHERE)

Definition at line 7 of file macros.h.

#define LOGF (   logger,
  severity,
  format_str,
  ... 
)    LOGF_CATEGORY(logger, severity, ::onnxruntime::logging::Category::onnxruntime, format_str, ##__VA_ARGS__)

Definition at line 109 of file macros.h.

#define LOGF_CATEGORY (   logger,
  severity,
  category,
  format_str,
  ... 
)
Value:
do { \
if ((logger).OutputIsEnabled(::onnxruntime::logging::Severity::k##severity, \
.CapturePrintf(format_str, ##__VA_ARGS__); \
} while (0)
GLenum GLenum severity
Definition: glcorearb.h:2539
#define CREATE_MESSAGE(logger, severity, category, datatype)
Definition: macros.h:7
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697

Definition at line 84 of file macros.h.

#define LOGF_CATEGORY_IF (   boolean_expression,
  logger,
  severity,
  category,
  format_str,
  ... 
)
Value:
do { \
if ((boolean_expression) == true) LOGF_CATEGORY(logger, severity, category, format_str, ##__VA_ARGS__); \
} while (0)
#define LOGF_CATEGORY(logger, severity, category, format_str,...)
Definition: macros.h:84
GLenum GLenum severity
Definition: glcorearb.h:2539
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697

Definition at line 178 of file macros.h.

#define LOGF_DEFAULT (   severity,
  format_str,
  ... 
)    LOGF_DEFAULT_CATEGORY(severity, ::onnxruntime::logging::Category::onnxruntime, format_str, ##__VA_ARGS__)

Definition at line 142 of file macros.h.

#define LOGF_DEFAULT_CATEGORY (   severity,
  category,
  format_str,
  ... 
)    LOGF_CATEGORY(::onnxruntime::logging::LoggingManager::DefaultLogger(), severity, category, format_str, ##__VA_ARGS__)

Definition at line 128 of file macros.h.

#define LOGF_DEFAULT_CATEGORY_IF (   boolean_expression,
  severity,
  category,
  format_str,
  ... 
)
Value:
do { \
if ((boolean_expression) == true) LOGF_DEFAULT_CATEGORY(severity, category, format_str, ##__VA_ARGS__); \
} while (0)
GLenum GLenum severity
Definition: glcorearb.h:2539
#define LOGF_DEFAULT_CATEGORY(severity, category, format_str,...)
Definition: macros.h:128
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697

Definition at line 183 of file macros.h.

#define LOGF_DEFAULT_IF (   boolean_expression,
  severity,
  format_str,
  ... 
)    LOGF_DEFAULT_CATEGORY_IF(boolean_expression, severity, ::onnxruntime::logging::Category::onnxruntime, format_str, ##__VA_ARGS__)

Definition at line 215 of file macros.h.

#define LOGF_IF (   boolean_expression,
  logger,
  severity,
  format_str,
  ... 
)    LOGF_CATEGORY_IF(boolean_expression, logger, severity, ::onnxruntime::logging::Category::onnxruntime, format_str, ##__VA_ARGS__)

Definition at line 212 of file macros.h.

#define LOGF_USER (   logger,
  severity,
  format_str,
  ... 
)    LOGF_USER_CATEGORY(logger, severity, ::onnxruntime::logging::Category::onnxruntime, format_str, ##__VA_ARGS__)

Definition at line 112 of file macros.h.

#define LOGF_USER_CATEGORY (   logger,
  severity,
  category,
  format_str,
  ... 
)
Value:
do { \
if ((logger).OutputIsEnabled(::onnxruntime::logging::Severity::k##severity, \
.CapturePrintf(format_str, ##__VA_ARGS__); \
} while (0)
Contains potentially sensitive user data.
GLenum GLenum severity
Definition: glcorearb.h:2539
#define CREATE_MESSAGE(logger, severity, category, datatype)
Definition: macros.h:7
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697

Definition at line 92 of file macros.h.

#define LOGF_USER_CATEGORY_IF (   boolean_expression,
  logger,
  severity,
  category,
  format_str,
  ... 
)
Value:
do { \
if ((boolean_expression) == true) LOGF_USER_CATEGORY(logger, severity, category, format_str, ##__VA_ARGS__); \
} while (0)
GLenum GLenum severity
Definition: glcorearb.h:2539
#define LOGF_USER_CATEGORY(logger, severity, category, format_str,...)
Definition: macros.h:92
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697

Definition at line 188 of file macros.h.

#define LOGF_USER_DEFAULT (   severity,
  format_str,
  ... 
)    LOGF_USER_DEFAULT_CATEGORY(severity, ::onnxruntime::logging::Category::onnxruntime, format_str, ##__VA_ARGS__)

Definition at line 145 of file macros.h.

#define LOGF_USER_DEFAULT_CATEGORY (   severity,
  category,
  format_str,
  ... 
)    LOGF_USER_CATEGORY(::onnxruntime::logging::LoggingManager::DefaultLogger(), severity, category, format_str, ##__VA_ARGS__)

Definition at line 131 of file macros.h.

#define LOGF_USER_DEFAULT_CATEGORY_IF (   boolean_expression,
  severity,
  category,
  format_str,
  ... 
)
Value:
do { \
if ((boolean_expression) == true) LOGF_USER_DEFAULT_CATEGORY(severity, category, format_str, ##__VA_ARGS__); \
} while (0)
GLenum GLenum severity
Definition: glcorearb.h:2539
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697
#define LOGF_USER_DEFAULT_CATEGORY(severity, category, format_str,...)
Definition: macros.h:131

Definition at line 193 of file macros.h.

#define LOGF_USER_DEFAULT_IF (   boolean_expression,
  severity,
  format_str,
  ... 
)
Value:
format_str, ##__VA_ARGS__)
static const char * onnxruntime
General output.
Definition: logging.h:73
GLenum GLenum severity
Definition: glcorearb.h:2539
#define LOGF_USER_DEFAULT_CATEGORY_IF(boolean_expression, severity, category, format_str,...)
Definition: macros.h:193

Definition at line 222 of file macros.h.

#define LOGF_USER_IF (   boolean_expression,
  logger,
  severity,
  format_str,
  ... 
)
Value:
format_str, ##__VA_ARGS__)
static const char * onnxruntime
General output.
Definition: logging.h:73
GLenum GLenum severity
Definition: glcorearb.h:2539
#define LOGF_USER_CATEGORY_IF(boolean_expression, logger, severity, category, format_str,...)
Definition: macros.h:188

Definition at line 218 of file macros.h.

#define LOGS (   logger,
  severity 
)    LOGS_CATEGORY(logger, severity, ::onnxruntime::logging::Category::onnxruntime)

Definition at line 102 of file macros.h.

#define LOGS_CATEGORY (   logger,
  severity,
  category 
)
Value:
if (!(logger).OutputIsEnabled(::onnxruntime::logging::Severity::k##severity, \
/* do nothing */ \
CREATE_MESSAGE(logger, severity, category, ::onnxruntime::logging::DataType::SYSTEM).Stream()
GLenum GLenum severity
Definition: glcorearb.h:2539
#define CREATE_MESSAGE(logger, severity, category, datatype)
Definition: macros.h:7

Note: The stream style logging macros (something like LOGS() << message) are designed to be appended to. Normally, we can isolate macro code in a separate scope (e.g., do {...} while(0)), but here we need the macro code to interact with subsequent code (i.e., the values to log).

When an unisolated conditional is involved, extra care needs to be taken to avoid unexpected parsing behavior. For example:

if (enabled) Capture().Stream()

is more direct, but

if (!enabled) { } else Capture().Stream()

ensures that the if does not unintentionally associate with a subsequent else.

Definition at line 69 of file macros.h.

#define LOGS_CATEGORY_IF (   boolean_expression,
  logger,
  severity,
  category 
)
Value:
if (!((boolean_expression) == true)) { \
/* do nothing */ \
LOGS_CATEGORY(logger, severity, category)
#define LOGS_CATEGORY(logger, severity, category)
Definition: macros.h:69
GLenum GLenum severity
Definition: glcorearb.h:2539

Definition at line 154 of file macros.h.

Definition at line 136 of file macros.h.

#define LOGS_DEFAULT_CATEGORY (   severity,
  category 
)    LOGS_CATEGORY(::onnxruntime::logging::LoggingManager::DefaultLogger(), severity, category)

Definition at line 122 of file macros.h.

#define LOGS_DEFAULT_CATEGORY_IF (   boolean_expression,
  severity,
  category 
)
Value:
if (!((boolean_expression) == true)) { \
/* do nothing */ \
#define LOGS_DEFAULT_CATEGORY(severity, category)
Definition: macros.h:122
GLenum GLenum severity
Definition: glcorearb.h:2539

Definition at line 160 of file macros.h.

#define LOGS_DEFAULT_IF (   boolean_expression,
  severity 
)    LOGS_DEFAULT_CATEGORY_IF(boolean_expression, severity, ::onnxruntime::logging::Category::onnxruntime)

Definition at line 203 of file macros.h.

#define LOGS_IF (   boolean_expression,
  logger,
  severity 
)    LOGS_CATEGORY_IF(boolean_expression, logger, severity, ::onnxruntime::logging::Category::onnxruntime)

Definition at line 200 of file macros.h.

#define LOGS_USER (   logger,
  severity 
)    LOGS_USER_CATEGORY(logger, severity, ::onnxruntime::logging::Category::onnxruntime)

Definition at line 105 of file macros.h.

#define LOGS_USER_CATEGORY (   logger,
  severity,
  category 
)
Value:
if (!(logger).OutputIsEnabled(::onnxruntime::logging::Severity::k##severity, \
/* do nothing */ \
CREATE_MESSAGE(logger, severity, category, ::onnxruntime::logging::DataType::USER).Stream()
Contains potentially sensitive user data.
GLenum GLenum severity
Definition: glcorearb.h:2539
#define CREATE_MESSAGE(logger, severity, category, datatype)
Definition: macros.h:7

Definition at line 76 of file macros.h.

#define LOGS_USER_CATEGORY_IF (   boolean_expression,
  logger,
  severity,
  category 
)
Value:
if (!((boolean_expression) == true)) { \
/* do nothing */ \
LOGS_USER_CATEGORY(logger, severity, category)
GLenum GLenum severity
Definition: glcorearb.h:2539
#define LOGS_USER_CATEGORY(logger, severity, category)
Definition: macros.h:76

Definition at line 166 of file macros.h.

Definition at line 139 of file macros.h.

#define LOGS_USER_DEFAULT_CATEGORY (   severity,
  category 
)    LOGS_USER_CATEGORY(::onnxruntime::logging::LoggingManager::DefaultLogger(), severity, category)

Definition at line 125 of file macros.h.

#define LOGS_USER_DEFAULT_CATEGORY_IF (   boolean_expression,
  severity,
  category 
)
Value:
if (!((boolean_expression) == true)) { \
/* do nothing */ \
GLenum GLenum severity
Definition: glcorearb.h:2539
#define LOGS_USER_DEFAULT_CATEGORY(severity, category)
Definition: macros.h:125

Definition at line 172 of file macros.h.

#define LOGS_USER_DEFAULT_IF (   boolean_expression,
  severity 
)    LOGS_USER_DEFAULT_CATEGORY_IF(boolean_expression, severity, ::onnxruntime::logging::Category::onnxruntime)

Definition at line 209 of file macros.h.

#define LOGS_USER_IF (   boolean_expression,
  logger,
  severity 
)    LOGS_USER_CATEGORY_IF(boolean_expression, logger, severity, ::onnxruntime::logging::Category::onnxruntime)

Definition at line 206 of file macros.h.

#define VLOGF (   logger,
  level,
  format_str,
  ... 
)
Value:
do { \
if (::onnxruntime::logging::vlog_enabled && level <= (logger).VLOGMaxLevel()) \
LOGF_CATEGORY(logger, VERBOSE, "VLOG" #level, format_str, ##__VA_ARGS__); \
} while (0)
#define LOGF_CATEGORY(logger, severity, category, format_str,...)
Definition: macros.h:84
GLint level
Definition: glcorearb.h:108
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697

Definition at line 244 of file macros.h.

#define VLOGF_DEFAULT (   level,
  format_str,
  ... 
)    VLOGF(::onnxruntime::logging::LoggingManager::DefaultLogger(), level, format_str, ##__VA_ARGS__)

Definition at line 276 of file macros.h.

#define VLOGF_USER (   logger,
  level,
  format_str,
  ... 
)
Value:
do { \
if (::onnxruntime::logging::vlog_enabled && level <= (logger).VLOGMaxLevel()) \
LOGF_USER_CATEGORY(logger, VERBOSE, "VLOG" #level, format_str, ##__VA_ARGS__); \
} while (0)
GLint level
Definition: glcorearb.h:108
#define LOGF_USER_CATEGORY(logger, severity, category, format_str,...)
Definition: macros.h:92
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697

Definition at line 250 of file macros.h.

#define VLOGF_USER_DEFAULT (   level,
  format_str,
  ... 
)    VLOGF_USER(::onnxruntime::logging::LoggingManager::DefaultLogger(), level, format_str, ##__VA_ARGS__)

Definition at line 279 of file macros.h.

#define VLOGS (   logger,
  level 
)
Value:
if (!(::onnxruntime::logging::vlog_enabled && level <= (logger).VLOGMaxLevel())) { \
/* do nothing */ \
LOGS_CATEGORY(logger, VERBOSE, "VLOG" #level)
GLint level
Definition: glcorearb.h:108
#define LOGS_CATEGORY(logger, severity, category)
Definition: macros.h:69

Definition at line 232 of file macros.h.

#define VLOGS_DEFAULT (   level)    VLOGS(::onnxruntime::logging::LoggingManager::DefaultLogger(), level)

Definition at line 270 of file macros.h.

#define VLOGS_USER (   logger,
  level 
)
Value:
if (!(::onnxruntime::logging::vlog_enabled && level <= (logger).VLOGMaxLevel())) { \
/* do nothing */ \
LOGS_USER_CATEGORY(logger, VERBOSE, "VLOG" #level)
GLint level
Definition: glcorearb.h:108
#define LOGS_USER_CATEGORY(logger, severity, category)
Definition: macros.h:76

Definition at line 238 of file macros.h.

#define VLOGS_USER_DEFAULT (   level)    VLOGS_USER(::onnxruntime::logging::LoggingManager::DefaultLogger(), level)

Definition at line 273 of file macros.h.