Go to the documentation of this file.
7 #define CREATE_MESSAGE(logger, severity, category, datatype) \
8 ::onnxruntime::logging::Capture(logger, ::onnxruntime::logging::Severity::k##severity, category, datatype, ORT_WHERE)
69 #define LOGS_CATEGORY(logger, severity, category) \
70 if (!(logger).OutputIsEnabled(::onnxruntime::logging::Severity::k##severity, \
71 ::onnxruntime::logging::DataType::SYSTEM)) { \
74 CREATE_MESSAGE(logger, severity, category, ::onnxruntime::logging::DataType::SYSTEM).Stream()
76 #define LOGS_USER_CATEGORY(logger, severity, category) \
77 if (!(logger).OutputIsEnabled(::onnxruntime::logging::Severity::k##severity, \
78 ::onnxruntime::logging::DataType::USER)) { \
81 CREATE_MESSAGE(logger, severity, category, ::onnxruntime::logging::DataType::USER).Stream()
84 #define LOGF_CATEGORY(logger, severity, category, format_str, ...) \
86 if ((logger).OutputIsEnabled(::onnxruntime::logging::Severity::k##severity, \
87 ::onnxruntime::logging::DataType::SYSTEM)) \
88 CREATE_MESSAGE(logger, severity, category, ::onnxruntime::logging::DataType::SYSTEM) \
89 .CapturePrintf(format_str, ##__VA_ARGS__); \
92 #define LOGF_USER_CATEGORY(logger, severity, category, format_str, ...) \
94 if ((logger).OutputIsEnabled(::onnxruntime::logging::Severity::k##severity, \
95 ::onnxruntime::logging::DataType::USER)) \
96 CREATE_MESSAGE(logger, severity, category, ::onnxruntime::logging::DataType::USER) \
97 .CapturePrintf(format_str, ##__VA_ARGS__); \
102 #define LOGS(logger, severity) \
103 LOGS_CATEGORY(logger, severity, ::onnxruntime::logging::Category::onnxruntime)
105 #define LOGS_USER(logger, severity) \
106 LOGS_USER_CATEGORY(logger, severity, ::onnxruntime::logging::Category::onnxruntime)
109 #define LOGF(logger, severity, format_str, ...) \
110 LOGF_CATEGORY(logger, severity, ::onnxruntime::logging::Category::onnxruntime, format_str, ##__VA_ARGS__)
112 #define LOGF_USER(logger, severity, format_str, ...) \
113 LOGF_USER_CATEGORY(logger, severity, ::onnxruntime::logging::Category::onnxruntime, format_str, ##__VA_ARGS__)
122 #define LOGS_DEFAULT_CATEGORY(severity, category) \
123 LOGS_CATEGORY(::onnxruntime::logging::LoggingManager::DefaultLogger(), severity, category)
125 #define LOGS_USER_DEFAULT_CATEGORY(severity, category) \
126 LOGS_USER_CATEGORY(::onnxruntime::logging::LoggingManager::DefaultLogger(), severity, category)
128 #define LOGF_DEFAULT_CATEGORY(severity, category, format_str, ...) \
129 LOGF_CATEGORY(::onnxruntime::logging::LoggingManager::DefaultLogger(), severity, category, format_str, ##__VA_ARGS__)
131 #define LOGF_USER_DEFAULT_CATEGORY(severity, category, format_str, ...) \
132 LOGF_USER_CATEGORY(::onnxruntime::logging::LoggingManager::DefaultLogger(), severity, category, format_str, ##__VA_ARGS__)
136 #define LOGS_DEFAULT(severity) \
137 LOGS_DEFAULT_CATEGORY(severity, ::onnxruntime::logging::Category::onnxruntime)
139 #define LOGS_USER_DEFAULT(severity) \
140 LOGS_USER_DEFAULT_CATEGORY(severity, ::onnxruntime::logging::Category::onnxruntime)
142 #define LOGF_DEFAULT(severity, format_str, ...) \
143 LOGF_DEFAULT_CATEGORY(severity, ::onnxruntime::logging::Category::onnxruntime, format_str, ##__VA_ARGS__)
145 #define LOGF_USER_DEFAULT(severity, format_str, ...) \
146 LOGF_USER_DEFAULT_CATEGORY(severity, ::onnxruntime::logging::Category::onnxruntime, format_str, ##__VA_ARGS__)
154 #define LOGS_CATEGORY_IF(boolean_expression, logger, severity, category) \
155 if (!((boolean_expression) == true)) { \
158 LOGS_CATEGORY(logger, severity, category)
160 #define LOGS_DEFAULT_CATEGORY_IF(boolean_expression, severity, category) \
161 if (!((boolean_expression) == true)) { \
164 LOGS_DEFAULT_CATEGORY(severity, category)
166 #define LOGS_USER_CATEGORY_IF(boolean_expression, logger, severity, category) \
167 if (!((boolean_expression) == true)) { \
170 LOGS_USER_CATEGORY(logger, severity, category)
172 #define LOGS_USER_DEFAULT_CATEGORY_IF(boolean_expression, severity, category) \
173 if (!((boolean_expression) == true)) { \
176 LOGS_USER_DEFAULT_CATEGORY(severity, category)
178 #define LOGF_CATEGORY_IF(boolean_expression, logger, severity, category, format_str, ...) \
180 if ((boolean_expression) == true) LOGF_CATEGORY(logger, severity, category, format_str, ##__VA_ARGS__); \
183 #define LOGF_DEFAULT_CATEGORY_IF(boolean_expression, severity, category, format_str, ...) \
185 if ((boolean_expression) == true) LOGF_DEFAULT_CATEGORY(severity, category, format_str, ##__VA_ARGS__); \
188 #define LOGF_USER_CATEGORY_IF(boolean_expression, logger, severity, category, format_str, ...) \
190 if ((boolean_expression) == true) LOGF_USER_CATEGORY(logger, severity, category, format_str, ##__VA_ARGS__); \
193 #define LOGF_USER_DEFAULT_CATEGORY_IF(boolean_expression, severity, category, format_str, ...) \
195 if ((boolean_expression) == true) LOGF_USER_DEFAULT_CATEGORY(severity, category, format_str, ##__VA_ARGS__); \
200 #define LOGS_IF(boolean_expression, logger, severity) \
201 LOGS_CATEGORY_IF(boolean_expression, logger, severity, ::onnxruntime::logging::Category::onnxruntime)
203 #define LOGS_DEFAULT_IF(boolean_expression, severity) \
204 LOGS_DEFAULT_CATEGORY_IF(boolean_expression, severity, ::onnxruntime::logging::Category::onnxruntime)
206 #define LOGS_USER_IF(boolean_expression, logger, severity) \
207 LOGS_USER_CATEGORY_IF(boolean_expression, logger, severity, ::onnxruntime::logging::Category::onnxruntime)
209 #define LOGS_USER_DEFAULT_IF(boolean_expression, severity) \
210 LOGS_USER_DEFAULT_CATEGORY_IF(boolean_expression, severity, ::onnxruntime::logging::Category::onnxruntime)
212 #define LOGF_IF(boolean_expression, logger, severity, format_str, ...) \
213 LOGF_CATEGORY_IF(boolean_expression, logger, severity, ::onnxruntime::logging::Category::onnxruntime, format_str, ##__VA_ARGS__)
215 #define LOGF_DEFAULT_IF(boolean_expression, severity, format_str, ...) \
216 LOGF_DEFAULT_CATEGORY_IF(boolean_expression, severity, ::onnxruntime::logging::Category::onnxruntime, format_str, ##__VA_ARGS__)
218 #define LOGF_USER_IF(boolean_expression, logger, severity, format_str, ...) \
219 LOGF_USER_CATEGORY_IF(boolean_expression, logger, severity, ::onnxruntime::logging::Category::onnxruntime, \
220 format_str, ##__VA_ARGS__)
222 #define LOGF_USER_DEFAULT_IF(boolean_expression, severity, format_str, ...) \
223 LOGF_USER_DEFAULT_CATEGORY_IF(boolean_expression, severity, ::onnxruntime::logging::Category::onnxruntime, \
224 format_str, ##__VA_ARGS__)
232 #define VLOGS(logger, level) \
233 if (!(::onnxruntime::logging::vlog_enabled && level <= (logger).VLOGMaxLevel())) { \
236 LOGS_CATEGORY(logger, VERBOSE, "VLOG" #level)
238 #define VLOGS_USER(logger, level) \
239 if (!(::onnxruntime::logging::vlog_enabled && level <= (logger).VLOGMaxLevel())) { \
242 LOGS_USER_CATEGORY(logger, VERBOSE, "VLOG" #level)
244 #define VLOGF(logger, level, format_str, ...) \
246 if (::onnxruntime::logging::vlog_enabled && level <= (logger).VLOGMaxLevel()) \
247 LOGF_CATEGORY(logger, VERBOSE, "VLOG" #level, format_str, ##__VA_ARGS__); \
250 #define VLOGF_USER(logger, level, format_str, ...) \
252 if (::onnxruntime::logging::vlog_enabled && level <= (logger).VLOGMaxLevel()) \
253 LOGF_USER_CATEGORY(logger, VERBOSE, "VLOG" #level, format_str, ##__VA_ARGS__); \
257 #define VLOGS(logger, level) \
258 if constexpr (true) { \
260 LOGS_CATEGORY(logger, VERBOSE, "VLOG" #level)
261 #define VLOGS_USER(logger, level) \
262 if constexpr (true) { \
264 LOGS_USER_CATEGORY(logger, VERBOSE, "VLOG" #level)
265 #define VLOGF(logger, level, format_str, ...)
266 #define VLOGF_USER(logger, level, format_str, ...)
270 #define VLOGS_DEFAULT(level) \
271 VLOGS(::onnxruntime::logging::LoggingManager::DefaultLogger(), level)
273 #define VLOGS_USER_DEFAULT(level) \
274 VLOGS_USER(::onnxruntime::logging::LoggingManager::DefaultLogger(), level)
276 #define VLOGF_DEFAULT(level, format_str, ...) \
277 VLOGF(::onnxruntime::logging::LoggingManager::DefaultLogger(), level, format_str, ##__VA_ARGS__)
279 #define VLOGF_USER_DEFAULT(level, format_str, ...) \
280 VLOGF_USER(::onnxruntime::logging::LoggingManager::DefaultLogger(), level, format_str, ##__VA_ARGS__)