You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

457 lines
18 KiB

  1. // -*- C++ -*-
  2. // Module: Log4CPLUS
  3. // File: loggingmacros.h
  4. // Created: 8/2003
  5. // Author: Tad E. Smith
  6. //
  7. //
  8. // Copyright 2003-2013 Tad E. Smith
  9. //
  10. // Licensed under the Apache License, Version 2.0 (the "License");
  11. // you may not use this file except in compliance with the License.
  12. // You may obtain a copy of the License at
  13. //
  14. // http://www.apache.org/licenses/LICENSE-2.0
  15. //
  16. // Unless required by applicable law or agreed to in writing, software
  17. // distributed under the License is distributed on an "AS IS" BASIS,
  18. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19. // See the License for the specific language governing permissions and
  20. // limitations under the License.
  21. /** @file
  22. * This header defines the logging macros. */
  23. #ifndef LOG4CPLUS_LOGGING_MACROS_HEADER_
  24. #define LOG4CPLUS_LOGGING_MACROS_HEADER_
  25. #include <log4cplus/config.hxx>
  26. #if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
  27. #pragma once
  28. #endif
  29. #include <log4cplus/streams.h>
  30. #include <log4cplus/logger.h>
  31. #include <log4cplus/helpers/snprintf.h>
  32. #include <log4cplus/tracelogger.h>
  33. #include <sstream>
  34. #include <utility>
  35. #if defined(_MSC_VER)
  36. #define LOG4CPLUS_SUPPRESS_DOWHILE_WARNING() \
  37. __pragma (warning (push)) \
  38. __pragma (warning (disable:4127))
  39. #define LOG4CPLUS_RESTORE_DOWHILE_WARNING() \
  40. __pragma (warning (pop))
  41. #else
  42. #define LOG4CPLUS_SUPPRESS_DOWHILE_WARNING() /* empty */
  43. #define LOG4CPLUS_RESTORE_DOWHILE_WARNING() /* empty */
  44. #endif
  45. #define LOG4CPLUS_DOWHILE_NOTHING() \
  46. LOG4CPLUS_SUPPRESS_DOWHILE_WARNING() \
  47. do { } while (0) \
  48. LOG4CPLUS_RESTORE_DOWHILE_WARNING()
  49. #if defined(LOG4CPLUS_DISABLE_FATAL) && !defined(LOG4CPLUS_DISABLE_ERROR)
  50. #define LOG4CPLUS_DISABLE_ERROR
  51. #endif
  52. #if defined(LOG4CPLUS_DISABLE_ERROR) && !defined(LOG4CPLUS_DISABLE_WARN)
  53. #define LOG4CPLUS_DISABLE_WARN
  54. #endif
  55. #if defined(LOG4CPLUS_DISABLE_WARN) && !defined(LOG4CPLUS_DISABLE_INFO)
  56. #define LOG4CPLUS_DISABLE_INFO
  57. #endif
  58. #if defined(LOG4CPLUS_DISABLE_INFO) && !defined(LOG4CPLUS_DISABLE_DEBUG)
  59. #define LOG4CPLUS_DISABLE_DEBUG
  60. #endif
  61. #if defined(LOG4CPLUS_DISABLE_DEBUG) && !defined(LOG4CPLUS_DISABLE_TRACE)
  62. #define LOG4CPLUS_DISABLE_TRACE
  63. #endif
  64. namespace log4cplus
  65. {
  66. namespace detail
  67. {
  68. inline
  69. Logger
  70. macros_get_logger (Logger const & logger)
  71. {
  72. return logger;
  73. }
  74. inline
  75. Logger const &
  76. macros_get_logger (Logger & logger)
  77. {
  78. return logger;
  79. }
  80. #if defined (LOG4CPLUS_HAVE_RVALUE_REFS)
  81. inline
  82. Logger
  83. macros_get_logger (Logger && logger)
  84. {
  85. return std::move (logger);
  86. }
  87. #endif
  88. inline
  89. Logger
  90. macros_get_logger (tstring const & logger)
  91. {
  92. return Logger::getInstance (logger);
  93. }
  94. inline
  95. Logger
  96. macros_get_logger (tchar const * logger)
  97. {
  98. return Logger::getInstance (logger);
  99. }
  100. LOG4CPLUS_EXPORT void clear_tostringstream (tostringstream &);
  101. LOG4CPLUS_EXPORT log4cplus::tostringstream & get_macro_body_oss ();
  102. LOG4CPLUS_EXPORT log4cplus::helpers::snprintf_buf & get_macro_body_snprintf_buf ();
  103. LOG4CPLUS_EXPORT void macro_forced_log (log4cplus::Logger const &,
  104. log4cplus::LogLevel, log4cplus::tstring const &, char const *, int,
  105. char const *);
  106. } // namespace detail
  107. } // namespace log4cplus
  108. #if ! defined (LOG4CPLUS_DISABLE_FUNCTION_MACRO) \
  109. && ! defined (LOG4CPLUS_MACRO_FUNCTION)
  110. # if defined (LOG4CPLUS_HAVE_FUNCSIG_MACRO)
  111. # define LOG4CPLUS_MACRO_FUNCTION() __FUNCSIG__
  112. # elif defined (LOG4CPLUS_HAVE_PRETTY_FUNCTION_MACRO)
  113. # define LOG4CPLUS_MACRO_FUNCTION() __PRETTY_FUNCTION__
  114. # elif defined (LOG4CPLUS_HAVE_FUNCTION_MACRO)
  115. # define LOG4CPLUS_MACRO_FUNCTION() __FUNCTION__
  116. # elif defined (LOG4CPLUS_HAVE_FUNC_SYMBOL)
  117. # define LOG4CPLUS_MACRO_FUNCTION() __func__
  118. # endif
  119. #endif
  120. #if ! defined (LOG4CPLUS_MACRO_FUNCTION)
  121. # define LOG4CPLUS_MACRO_FUNCTION() 0
  122. #endif
  123. // Make TRACE and DEBUG log level unlikely and INFO, WARN, ERROR and
  124. // FATAL log level likely.
  125. #define LOG4CPLUS_MACRO_TRACE_LOG_LEVEL(pred) \
  126. LOG4CPLUS_UNLIKELY (pred)
  127. #define LOG4CPLUS_MACRO_DEBUG_LOG_LEVEL(pred) \
  128. LOG4CPLUS_UNLIKELY (pred)
  129. #define LOG4CPLUS_MACRO_INFO_LOG_LEVEL(pred) \
  130. LOG4CPLUS_LIKELY (pred)
  131. #define LOG4CPLUS_MACRO_WARN_LOG_LEVEL(pred) \
  132. LOG4CPLUS_LIKELY (pred)
  133. #define LOG4CPLUS_MACRO_ERROR_LOG_LEVEL(pred) \
  134. LOG4CPLUS_LIKELY (pred)
  135. #define LOG4CPLUS_MACRO_FATAL_LOG_LEVEL(pred) \
  136. LOG4CPLUS_LIKELY (pred)
  137. //! Dispatch to LOG4CPLUS_MACRO_LOGLEVEL_* depending on log level.
  138. #define LOG4CPLUS_MACRO_LOGLEVEL_PRED(pred, logLevel) \
  139. LOG4CPLUS_MACRO_ ## logLevel (pred)
  140. // Either use temporary instances of ostringstream
  141. // and snprintf_buf, or use thread-local instances.
  142. #if defined (LOG4CPLUS_MACRO_DISABLE_TLS)
  143. # define LOG4CPLUS_MACRO_INSTANTIATE_OSTRINGSTREAM(var) \
  144. log4cplus::tostringstream var
  145. # define LOG4CPLUS_MACRO_INSTANTIATE_SNPRINTF_BUF(var) \
  146. log4cplus::helpers::snprintf_buf var
  147. #else
  148. # define LOG4CPLUS_MACRO_INSTANTIATE_OSTRINGSTREAM(var) \
  149. log4cplus::tostringstream & var \
  150. = log4cplus::detail::get_macro_body_oss ()
  151. # define LOG4CPLUS_MACRO_INSTANTIATE_SNPRINTF_BUF(var) \
  152. log4cplus::helpers::snprintf_buf & var \
  153. = log4cplus::detail::get_macro_body_snprintf_buf ()
  154. #endif
  155. #define LOG4CPLUS_MACRO_BODY(logger, logEvent, logLevel) \
  156. LOG4CPLUS_SUPPRESS_DOWHILE_WARNING() \
  157. do { \
  158. log4cplus::Logger const & _l \
  159. = log4cplus::detail::macros_get_logger (logger); \
  160. if (LOG4CPLUS_MACRO_LOGLEVEL_PRED ( \
  161. _l.isEnabledFor (log4cplus::logLevel), logLevel)) { \
  162. LOG4CPLUS_MACRO_INSTANTIATE_OSTRINGSTREAM (_log4cplus_buf); \
  163. _log4cplus_buf << logEvent; \
  164. log4cplus::detail::macro_forced_log (_l, \
  165. log4cplus::logLevel, _log4cplus_buf.str(), \
  166. __FILE__, __LINE__, LOG4CPLUS_MACRO_FUNCTION ()); \
  167. } \
  168. } while (0) \
  169. LOG4CPLUS_RESTORE_DOWHILE_WARNING()
  170. #define LOG4CPLUS_MACRO_STR_BODY(logger, logEvent, logLevel) \
  171. LOG4CPLUS_SUPPRESS_DOWHILE_WARNING() \
  172. do { \
  173. log4cplus::Logger const & _l \
  174. = log4cplus::detail::macros_get_logger (logger); \
  175. if (LOG4CPLUS_MACRO_LOGLEVEL_PRED ( \
  176. _l.isEnabledFor (log4cplus::logLevel), logLevel)) { \
  177. log4cplus::detail::macro_forced_log (_l, \
  178. log4cplus::logLevel, logEvent, \
  179. __FILE__, __LINE__, LOG4CPLUS_MACRO_FUNCTION ()); \
  180. } \
  181. } while(0) \
  182. LOG4CPLUS_RESTORE_DOWHILE_WARNING()
  183. #if defined (LOG4CPLUS_HAVE_C99_VARIADIC_MACROS)
  184. #define LOG4CPLUS_MACRO_FMT_BODY(logger, logLevel, logFmt, ...) \
  185. LOG4CPLUS_SUPPRESS_DOWHILE_WARNING() \
  186. do { \
  187. log4cplus::Logger const & _l \
  188. = log4cplus::detail::macros_get_logger (logger); \
  189. if (LOG4CPLUS_MACRO_LOGLEVEL_PRED ( \
  190. _l.isEnabledFor (log4cplus::logLevel), logLevel)) { \
  191. LOG4CPLUS_MACRO_INSTANTIATE_SNPRINTF_BUF (_snpbuf); \
  192. log4cplus::tchar const * _logEvent \
  193. = _snpbuf.print (logFmt, __VA_ARGS__); \
  194. log4cplus::detail::macro_forced_log (_l, \
  195. log4cplus::logLevel, _logEvent, \
  196. __FILE__, __LINE__, LOG4CPLUS_MACRO_FUNCTION ()); \
  197. } \
  198. } while(0) \
  199. LOG4CPLUS_RESTORE_DOWHILE_WARNING()
  200. #elif defined (LOG4CPLUS_HAVE_GNU_VARIADIC_MACROS)
  201. #define LOG4CPLUS_MACRO_FMT_BODY(logger, logLevel, logFmt, logArgs...) \
  202. LOG4CPLUS_SUPPRESS_DOWHILE_WARNING() \
  203. do { \
  204. log4cplus::Logger const & _l \
  205. = log4cplus::detail::macros_get_logger (logger); \
  206. if (LOG4CPLUS_MACRO_LOGLEVEL_PRED ( \
  207. _l.isEnabledFor (log4cplus::logLevel), logLevel)) { \
  208. LOG4CPLUS_MACRO_INSTANTIATE_SNPRINTF_BUF (_snpbuf); \
  209. log4cplus::tchar const * _logEvent \
  210. = _snpbuf.print (logFmt, logArgs); \
  211. log4cplus::detail::macro_forced_log (_l, \
  212. log4cplus::logLevel, _logEvent, \
  213. __FILE__, __LINE__, LOG4CPLUS_MACRO_FUNCTION ()); \
  214. } \
  215. } while(0) \
  216. LOG4CPLUS_RESTORE_DOWHILE_WARNING()
  217. #endif
  218. /**
  219. * @def LOG4CPLUS_TRACE(logger, logEvent) This macro creates a
  220. * TraceLogger to log a TRACE_LOG_LEVEL message to <code>logger</code>
  221. * upon entry and exiting of a method.
  222. * <code>logEvent</code> will be streamed into an <code>ostream</code>.
  223. */
  224. #if !defined(LOG4CPLUS_DISABLE_TRACE)
  225. #define LOG4CPLUS_TRACE_METHOD(logger, logEvent) \
  226. log4cplus::TraceLogger _log4cplus_trace_logger(logger, logEvent, \
  227. __FILE__, __LINE__);
  228. #define LOG4CPLUS_TRACE(logger, logEvent) \
  229. LOG4CPLUS_MACRO_BODY (logger, logEvent, TRACE_LOG_LEVEL)
  230. #define LOG4CPLUS_TRACE_STR(logger, logEvent) \
  231. LOG4CPLUS_MACRO_STR_BODY (logger, logEvent, TRACE_LOG_LEVEL)
  232. #if defined (LOG4CPLUS_HAVE_C99_VARIADIC_MACROS)
  233. #define LOG4CPLUS_TRACE_FMT(logger, logFmt, ...) \
  234. LOG4CPLUS_MACRO_FMT_BODY (logger, TRACE_LOG_LEVEL, logFmt, __VA_ARGS__)
  235. #elif defined (LOG4CPLUS_HAVE_GNU_VARIADIC_MACROS)
  236. #define LOG4CPLUS_TRACE_FMT(logger, logFmt, logArgs...) \
  237. LOG4CPLUS_MACRO_FMT_BODY(logger, TRACE_LOG_LEVEL, logFmt, logArgs)
  238. #endif
  239. #else
  240. #define LOG4CPLUS_TRACE_METHOD(logger, logEvent) LOG4CPLUS_DOWHILE_NOTHING()
  241. #define LOG4CPLUS_TRACE(logger, logEvent) LOG4CPLUS_DOWHILE_NOTHING()
  242. #define LOG4CPLUS_TRACE_STR(logger, logEvent) LOG4CPLUS_DOWHILE_NOTHING()
  243. #if defined (LOG4CPLUS_HAVE_C99_VARIADIC_MACROS)
  244. #define LOG4CPLUS_TRACE_FMT(logger, logFmt, ...) LOG4CPLUS_DOWHILE_NOTHING()
  245. #elif defined (LOG4CPLUS_HAVE_GNU_VARIADIC_MACROS)
  246. #define LOG4CPLUS_TRACE_FMT(logger, logFmt, logArgs...) LOG4CPLUS_DOWHILE_NOTHING()
  247. #endif
  248. #endif
  249. /**
  250. * @def LOG4CPLUS_DEBUG(logger, logEvent) This macro is used to log a
  251. * DEBUG_LOG_LEVEL message to <code>logger</code>.
  252. * <code>logEvent</code> will be streamed into an <code>ostream</code>.
  253. */
  254. #if !defined(LOG4CPLUS_DISABLE_DEBUG)
  255. #define LOG4CPLUS_DEBUG(logger, logEvent) \
  256. LOG4CPLUS_MACRO_BODY (logger, logEvent, DEBUG_LOG_LEVEL)
  257. #define LOG4CPLUS_DEBUG_STR(logger, logEvent) \
  258. LOG4CPLUS_MACRO_STR_BODY (logger, logEvent, DEBUG_LOG_LEVEL)
  259. #if defined (LOG4CPLUS_HAVE_C99_VARIADIC_MACROS)
  260. #define LOG4CPLUS_DEBUG_FMT(logger, logFmt, ...) \
  261. LOG4CPLUS_MACRO_FMT_BODY (logger, DEBUG_LOG_LEVEL, logFmt, __VA_ARGS__)
  262. #elif defined (LOG4CPLUS_HAVE_GNU_VARIADIC_MACROS)
  263. #define LOG4CPLUS_DEBUG_FMT(logger, logFmt, logArgs...) \
  264. LOG4CPLUS_MACRO_FMT_BODY(logger, DEBUG_LOG_LEVEL, logFmt, logArgs)
  265. #endif
  266. #else
  267. #define LOG4CPLUS_DEBUG(logger, logEvent) LOG4CPLUS_DOWHILE_NOTHING()
  268. #define LOG4CPLUS_DEBUG_STR(logger, logEvent) LOG4CPLUS_DOWHILE_NOTHING()
  269. #if defined (LOG4CPLUS_HAVE_C99_VARIADIC_MACROS)
  270. #define LOG4CPLUS_DEBUG_FMT(logger, logFmt, ...) LOG4CPLUS_DOWHILE_NOTHING()
  271. #elif defined (LOG4CPLUS_HAVE_GNU_VARIADIC_MACROS)
  272. #define LOG4CPLUS_DEBUG_FMT(logger, logFmt, logArgs...) LOG4CPLUS_DOWHILE_NOTHING()
  273. #endif
  274. #endif
  275. /**
  276. * @def LOG4CPLUS_INFO(logger, logEvent) This macro is used to log a
  277. * INFO_LOG_LEVEL message to <code>logger</code>.
  278. * <code>logEvent</code> will be streamed into an <code>ostream</code>.
  279. */
  280. #if !defined(LOG4CPLUS_DISABLE_INFO)
  281. #define LOG4CPLUS_INFO(logger, logEvent) \
  282. LOG4CPLUS_MACRO_BODY (logger, logEvent, INFO_LOG_LEVEL)
  283. #define LOG4CPLUS_INFO_STR(logger, logEvent) \
  284. LOG4CPLUS_MACRO_STR_BODY (logger, logEvent, INFO_LOG_LEVEL)
  285. #if defined (LOG4CPLUS_HAVE_C99_VARIADIC_MACROS)
  286. #define LOG4CPLUS_INFO_FMT(logger, logFmt, ...) \
  287. LOG4CPLUS_MACRO_FMT_BODY (logger, INFO_LOG_LEVEL, logFmt, __VA_ARGS__)
  288. #elif defined (LOG4CPLUS_HAVE_GNU_VARIADIC_MACROS)
  289. #define LOG4CPLUS_INFO_FMT(logger, logFmt, logArgs...) \
  290. LOG4CPLUS_MACRO_FMT_BODY(logger, INFO_LOG_LEVEL, logFmt, logArgs)
  291. #endif
  292. #else
  293. #define LOG4CPLUS_INFO(logger, logEvent) LOG4CPLUS_DOWHILE_NOTHING()
  294. #define LOG4CPLUS_INFO_STR(logger, logEvent) LOG4CPLUS_DOWHILE_NOTHING()
  295. #if defined (LOG4CPLUS_HAVE_C99_VARIADIC_MACROS)
  296. #define LOG4CPLUS_INFO_FMT(logger, logFmt, ...) LOG4CPLUS_DOWHILE_NOTHING()
  297. #elif defined (LOG4CPLUS_HAVE_GNU_VARIADIC_MACROS)
  298. #define LOG4CPLUS_INFO_FMT(logger, logFmt, logArgs...) LOG4CPLUS_DOWHILE_NOTHING()
  299. #endif
  300. #endif
  301. /**
  302. * @def LOG4CPLUS_WARN(logger, logEvent) This macro is used to log a
  303. * WARN_LOG_LEVEL message to <code>logger</code>.
  304. * <code>logEvent</code> will be streamed into an <code>ostream</code>.
  305. */
  306. #if !defined(LOG4CPLUS_DISABLE_WARN)
  307. #define LOG4CPLUS_WARN(logger, logEvent) \
  308. LOG4CPLUS_MACRO_BODY (logger, logEvent, WARN_LOG_LEVEL)
  309. #define LOG4CPLUS_WARN_STR(logger, logEvent) \
  310. LOG4CPLUS_MACRO_STR_BODY (logger, logEvent, WARN_LOG_LEVEL)
  311. #if defined (LOG4CPLUS_HAVE_C99_VARIADIC_MACROS)
  312. #define LOG4CPLUS_WARN_FMT(logger, logFmt, ...) \
  313. LOG4CPLUS_MACRO_FMT_BODY (logger, WARN_LOG_LEVEL, logFmt, __VA_ARGS__)
  314. #elif defined (LOG4CPLUS_HAVE_GNU_VARIADIC_MACROS)
  315. #define LOG4CPLUS_WARN_FMT(logger, logFmt, logArgs...) \
  316. LOG4CPLUS_MACRO_FMT_BODY(logger, WARN_LOG_LEVEL, logFmt, logArgs)
  317. #endif
  318. #else
  319. #define LOG4CPLUS_WARN(logger, logEvent) LOG4CPLUS_DOWHILE_NOTHING()
  320. #define LOG4CPLUS_WARN_STR(logger, logEvent) LOG4CPLUS_DOWHILE_NOTHING()
  321. #if defined (LOG4CPLUS_HAVE_C99_VARIADIC_MACROS)
  322. #define LOG4CPLUS_WARN_FMT(logger, logFmt, ...) LOG4CPLUS_DOWHILE_NOTHING()
  323. #elif defined (LOG4CPLUS_HAVE_GNU_VARIADIC_MACROS)
  324. #define LOG4CPLUS_WARN_FMT(logger, logFmt, logArgs...) LOG4CPLUS_DOWHILE_NOTHING()
  325. #endif
  326. #endif
  327. /**
  328. * @def LOG4CPLUS_ERROR(logger, logEvent) This macro is used to log a
  329. * ERROR_LOG_LEVEL message to <code>logger</code>.
  330. * <code>logEvent</code> will be streamed into an <code>ostream</code>.
  331. */
  332. #if !defined(LOG4CPLUS_DISABLE_ERROR)
  333. #define LOG4CPLUS_ERROR(logger, logEvent) \
  334. LOG4CPLUS_MACRO_BODY (logger, logEvent, ERROR_LOG_LEVEL)
  335. #define LOG4CPLUS_ERROR_STR(logger, logEvent) \
  336. LOG4CPLUS_MACRO_STR_BODY (logger, logEvent, ERROR_LOG_LEVEL)
  337. #if defined (LOG4CPLUS_HAVE_C99_VARIADIC_MACROS)
  338. #define LOG4CPLUS_ERROR_FMT(logger, logFmt, ...) \
  339. LOG4CPLUS_MACRO_FMT_BODY (logger, ERROR_LOG_LEVEL, logFmt, __VA_ARGS__)
  340. #elif defined (LOG4CPLUS_HAVE_GNU_VARIADIC_MACROS)
  341. #define LOG4CPLUS_ERROR_FMT(logger, logFmt, logArgs...) \
  342. LOG4CPLUS_MACRO_FMT_BODY(logger, ERROR_LOG_LEVEL, logFmt, logArgs)
  343. #endif
  344. #else
  345. #define LOG4CPLUS_ERROR(logger, logEvent) LOG4CPLUS_DOWHILE_NOTHING()
  346. #define LOG4CPLUS_ERROR_STR(logger, logEvent) LOG4CPLUS_DOWHILE_NOTHING()
  347. #if defined (LOG4CPLUS_HAVE_C99_VARIADIC_MACROS)
  348. #define LOG4CPLUS_ERROR_FMT(logger, logFmt, ...) LOG4CPLUS_DOWHILE_NOTHING()
  349. #elif defined (LOG4CPLUS_HAVE_GNU_VARIADIC_MACROS)
  350. #define LOG4CPLUS_ERROR_FMT(logger, logFmt, logArgs...) LOG4CPLUS_DOWHILE_NOTHING()
  351. #endif
  352. #endif
  353. /**
  354. * @def LOG4CPLUS_FATAL(logger, logEvent) This macro is used to log a
  355. * FATAL_LOG_LEVEL message to <code>logger</code>.
  356. * <code>logEvent</code> will be streamed into an <code>ostream</code>.
  357. */
  358. #if !defined(LOG4CPLUS_DISABLE_FATAL)
  359. #define LOG4CPLUS_FATAL(logger, logEvent) \
  360. LOG4CPLUS_MACRO_BODY (logger, logEvent, FATAL_LOG_LEVEL)
  361. #define LOG4CPLUS_FATAL_STR(logger, logEvent) \
  362. LOG4CPLUS_MACRO_STR_BODY (logger, logEvent, FATAL_LOG_LEVEL)
  363. #if defined (LOG4CPLUS_HAVE_C99_VARIADIC_MACROS)
  364. #define LOG4CPLUS_FATAL_FMT(logger, logFmt, ...) \
  365. LOG4CPLUS_MACRO_FMT_BODY (logger, FATAL_LOG_LEVEL, logFmt, __VA_ARGS__)
  366. #elif defined (LOG4CPLUS_HAVE_GNU_VARIADIC_MACROS)
  367. #define LOG4CPLUS_FATAL_FMT(logger, logFmt, logArgs...) \
  368. LOG4CPLUS_MACRO_FMT_BODY(logger, FATAL_LOG_LEVEL, logFmt, logArgs)
  369. #endif
  370. #else
  371. #define LOG4CPLUS_FATAL(logger, logEvent) LOG4CPLUS_DOWHILE_NOTHING()
  372. #define LOG4CPLUS_FATAL_STR(logger, logEvent) LOG4CPLUS_DOWHILE_NOTHING()
  373. #if defined (LOG4CPLUS_HAVE_C99_VARIADIC_MACROS)
  374. #define LOG4CPLUS_FATAL_FMT(logger, logFmt, ...) LOG4CPLUS_DOWHILE_NOTHING()
  375. #elif defined (LOG4CPLUS_HAVE_GNU_VARIADIC_MACROS)
  376. #define LOG4CPLUS_FATAL_FMT(logger, logFmt, logArgs...) LOG4CPLUS_DOWHILE_NOTHING()
  377. #endif
  378. #endif
  379. #endif /* LOG4CPLUS_LOGGING_MACROS_HEADER_ */