Commit 6283c759 authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook Github Bot

logging: minor clean up in Logger.h

Summary:
Update the comment describing the Logger class, and remove a `clang-format off`
since recent versions of `clang-format` appear to do a good job formatting this
macro.

Reviewed By: yfeldblum

Differential Revision: D6525996

fbshipit-source-id: 6abbb3740afb53feb2418ca890cd78af1eb5f7a2
parent 7fb9d9fd
...@@ -27,12 +27,11 @@ ...@@ -27,12 +27,11 @@
* *
* This macro generally should not be used directly by end users. * This macro generally should not be used directly by end users.
*/ */
/* clang-format off */
#define FB_LOG_IMPL(logger, level, type, ...) \ #define FB_LOG_IMPL(logger, level, type, ...) \
(!(logger).getCategory()->logCheck(level)) \ (!(logger).getCategory()->logCheck(level)) \
? ::folly::logDisabledHelper( \ ? ::folly::logDisabledHelper( \
std::integral_constant<bool, ::folly::isLogLevelFatal(level)>{}) \ std::integral_constant<bool, ::folly::isLogLevelFatal(level)>{}) \
: ::folly::LogStreamVoidify< ::folly::isLogLevelFatal(level)>{} & \ : ::folly::LogStreamVoidify<::folly::isLogLevelFatal(level)>{} & \
::folly::LogStreamProcessor{(logger).getCategory(), \ ::folly::LogStreamProcessor{(logger).getCategory(), \
(level), \ (level), \
__FILE__, \ __FILE__, \
...@@ -40,7 +39,6 @@ ...@@ -40,7 +39,6 @@
(type), \ (type), \
##__VA_ARGS__} \ ##__VA_ARGS__} \
.stream() .stream()
/* clang-format on */
/** /**
* Log a message to the specified logger. * Log a message to the specified logger.
...@@ -85,12 +83,12 @@ class LoggerDB; ...@@ -85,12 +83,12 @@ class LoggerDB;
class LogMessage; class LogMessage;
/** /**
* Logger is the class you will normally use to log messages. * Logger is the class you will use to specify the log category when logging
* messages with FB_LOG().
* *
* The Logger is really just a small wrapper class that contains a pointer * Logger is really just a small wrapper class that contains a pointer to the
* to the appropriate LogCategory object. It exists to allow for easy static * appropriate LogCategory object. It primarily exists as syntactic sugar to
* initialization of log categories, as well as to provide fast checking of the * allow for easily looking up LogCategory objects.
* current effective log level.
*/ */
class Logger { class Logger {
public: public:
......
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