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 @@ ...@@ -196,28 +196,26 @@
* initialized. On all subsequent calls, disabled log statements can be * initialized. On all subsequent calls, disabled log statements can be
* skipped with just a single check of the LogLevel. * skipped with just a single check of the LogLevel.
*/ */
/* clang-format off */ #define XLOG_IMPL(level, cond, type, ...) \
#define XLOG_IMPL(level, cond, type, ...) \ (!XLOG_IS_ON_IMPL(level) || !(cond)) \
(!XLOG_IS_ON_IMPL(level) || !(cond)) \ ? ::folly::logDisabledHelper( \
? ::folly::logDisabledHelper( \ ::folly::bool_constant<::folly::isLogLevelFatal(level)>{}) \
::folly::bool_constant<::folly::isLogLevelFatal(level)>{}) \ : ::folly::LogStreamVoidify<::folly::isLogLevelFatal(level)>{} & \
: ::folly::LogStreamVoidify< ::folly::isLogLevelFatal(level)>{} & \ ::folly::LogStreamProcessor( \
::folly::LogStreamProcessor( \ [] { \
[] { \ static ::folly::XlogCategoryInfo<XLOG_IS_IN_HEADER_FILE> \
static ::folly::XlogCategoryInfo<XLOG_IS_IN_HEADER_FILE> \ folly_detail_xlog_category; \
_xlogCategory_; \ return folly_detail_xlog_category.getInfo( \
return _xlogCategory_.getInfo( \ &xlog_detail::xlogFileScopeInfo); \
&xlog_detail::xlogFileScopeInfo); \ }(), \
}(), \ (level), \
(level), \ xlog_detail::getXlogCategoryName(XLOG_FILENAME, 0), \
xlog_detail::getXlogCategoryName(XLOG_FILENAME, 0), \ xlog_detail::isXlogCategoryOverridden(0), \
xlog_detail::isXlogCategoryOverridden(0), \ XLOG_FILENAME, \
XLOG_FILENAME, \ __LINE__, \
__LINE__, \ (type), \
(type), \ ##__VA_ARGS__) \
##__VA_ARGS__) \
.stream() .stream()
/* clang-format on */
/** /**
* Check if and XLOG() statement with the given log level would be enabled. * Check if and XLOG() statement with the given log level would be enabled.
...@@ -241,14 +239,15 @@ ...@@ -241,14 +239,15 @@
* *
* See XlogLevelInfo for the implementation details. * See XlogLevelInfo for the implementation details.
*/ */
#define XLOG_IS_ON_IMPL(level) \ #define XLOG_IS_ON_IMPL(level) \
([] { \ ([] { \
static ::folly::XlogLevelInfo<XLOG_IS_IN_HEADER_FILE> _xlogLevel_; \ static ::folly::XlogLevelInfo<XLOG_IS_IN_HEADER_FILE> \
return _xlogLevel_.check( \ folly_detail_xlog_level; \
(level), \ return folly_detail_xlog_level.check( \
xlog_detail::getXlogCategoryName(XLOG_FILENAME, 0), \ (level), \
xlog_detail::isXlogCategoryOverridden(0), \ xlog_detail::getXlogCategoryName(XLOG_FILENAME, 0), \
&xlog_detail::xlogFileScopeInfo); \ 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