Commit 7af069c3 authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook Github Bot

logging: update some static lambda variable names

Summary:
Update the static local variable names used in `XLOG_IMPL()` and
`XLOG_IS_ON_IMPL()` to match the naming style used in D8218663.

The current version of clang-format also appears to be able to format
`XLOG_IMPL()` correctly now, so remove the comments disabling it around this
macro body.

Reviewed By: yfeldblum

Differential Revision: D8816625

fbshipit-source-id: 155b759953de5d5db0b350f27870edf9f5516914
parent 130fca21
......@@ -196,28 +196,26 @@
* initialized. On all subsequent calls, disabled log statements can be
* skipped with just a single check of the LogLevel.
*/
/* clang-format off */
#define XLOG_IMPL(level, cond, type, ...) \
(!XLOG_IS_ON_IMPL(level) || !(cond)) \
? ::folly::logDisabledHelper( \
::folly::bool_constant<::folly::isLogLevelFatal(level)>{}) \
: ::folly::LogStreamVoidify< ::folly::isLogLevelFatal(level)>{} & \
::folly::LogStreamProcessor( \
[] { \
static ::folly::XlogCategoryInfo<XLOG_IS_IN_HEADER_FILE> \
_xlogCategory_; \
return _xlogCategory_.getInfo( \
&xlog_detail::xlogFileScopeInfo); \
}(), \
(level), \
xlog_detail::getXlogCategoryName(XLOG_FILENAME, 0), \
xlog_detail::isXlogCategoryOverridden(0), \
XLOG_FILENAME, \
__LINE__, \
(type), \
##__VA_ARGS__) \
#define XLOG_IMPL(level, cond, type, ...) \
(!XLOG_IS_ON_IMPL(level) || !(cond)) \
? ::folly::logDisabledHelper( \
::folly::bool_constant<::folly::isLogLevelFatal(level)>{}) \
: ::folly::LogStreamVoidify<::folly::isLogLevelFatal(level)>{} & \
::folly::LogStreamProcessor( \
[] { \
static ::folly::XlogCategoryInfo<XLOG_IS_IN_HEADER_FILE> \
folly_detail_xlog_category; \
return folly_detail_xlog_category.getInfo( \
&xlog_detail::xlogFileScopeInfo); \
}(), \
(level), \
xlog_detail::getXlogCategoryName(XLOG_FILENAME, 0), \
xlog_detail::isXlogCategoryOverridden(0), \
XLOG_FILENAME, \
__LINE__, \
(type), \
##__VA_ARGS__) \
.stream()
/* clang-format on */
/**
* Check if and XLOG() statement with the given log level would be enabled.
......@@ -241,14 +239,15 @@
*
* See XlogLevelInfo for the implementation details.
*/
#define XLOG_IS_ON_IMPL(level) \
([] { \
static ::folly::XlogLevelInfo<XLOG_IS_IN_HEADER_FILE> _xlogLevel_; \
return _xlogLevel_.check( \
(level), \
xlog_detail::getXlogCategoryName(XLOG_FILENAME, 0), \
xlog_detail::isXlogCategoryOverridden(0), \
&xlog_detail::xlogFileScopeInfo); \
#define XLOG_IS_ON_IMPL(level) \
([] { \
static ::folly::XlogLevelInfo<XLOG_IS_IN_HEADER_FILE> \
folly_detail_xlog_level; \
return folly_detail_xlog_level.check( \
(level), \
xlog_detail::getXlogCategoryName(XLOG_FILENAME, 0), \
xlog_detail::isXlogCategoryOverridden(0), \
&xlog_detail::xlogFileScopeInfo); \
}())
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment