logging: implement FATAL and DFATAL log levels
[folly.git] / folly / experimental / logging / xlog.h
index 452041f6fa150e1e16d7cbed94bcf2d6f97462ac..8840dd5109b4165c8c56eeeb7fb95f7c07e4f507 100644 (file)
  *   initialized.  On all subsequent calls, disabled log statements can be
  *   skipped with just a single check of the LogLevel.
  */
-#define XLOG_IMPL(level, type, ...)                        \
-  (!XLOG_IS_ON_IMPL(level)) ? static_cast<void>(0)         \
-                            : ::folly::LogStreamProcessor( \
-                                  XLOG_GET_CATEGORY(),     \
-                                  (level),                 \
-                                  __FILE__,                \
-                                  __LINE__,                \
-                                  (type),                  \
-                                  ##__VA_ARGS__) &         \
+#define XLOG_IMPL(level, type, ...)                                    \
+  (!XLOG_IS_ON_IMPL(level))                                            \
+      ? static_cast<void>(0)                                           \
+      : ::folly::LogStreamProcessorT<::folly::isLogLevelFatal(level)>( \
+            XLOG_GET_CATEGORY(),                                       \
+            (level),                                                   \
+            __FILE__,                                                  \
+            __LINE__,                                                  \
+            (type),                                                    \
+            ##__VA_ARGS__) &                                           \
           ::folly::LogStream()
 
 /**