proxygen
Logger.h File Reference

Go to the source code of this file.

Classes

class  folly::Logger
 

Namespaces

 folly
 —— Concurrent Priority Queue Implementation ——
 

Macros

#define FB_LOG(logger, level, ...)
 
#define FB_LOGF(logger, level, fmt, arg1, ...)
 
#define FB_LOG_RAW(logger, level, filename, linenumber, functionName, ...)
 
#define FB_LOGF_RAW(logger, level, filename, linenumber, functionName, fmt, arg1, ...)
 
#define FB_LOG_IMPL(logger, level, type, ...)
 
#define FB_LOG_RAW_IMPL(logger, level, filename, line, functionName, type, ...)
 

Macro Definition Documentation

#define FB_LOG (   logger,
  level,
  ... 
)
Value:
logger, \
::folly::LogLevel::level, \
##__VA_ARGS__)
#define FB_LOG_IMPL(logger, level, type,...)
Definition: Logger.h:107

Log a message to the specified logger.

This macro avoids evaluating the log arguments unless the log level check succeeds.

Beware that the logger argument is evaluated twice, so this argument should be an expression with no side-effects.

Definition at line 34 of file Logger.h.

Referenced by fbLogFatalCheck(), TEST_F(), and testNumHandlers().

#define FB_LOG_IMPL (   logger,
  level,
  type,
  ... 
)
Value:
(!(logger).getCategory()->logCheck(level)) \
::folly::LogStreamProcessor{(logger).getCategory(), \
(level), \
__FILE__, \
__LINE__, \
__func__, \
(type), \
##__VA_ARGS__} \
.stream()
void logDisabledHelper(std::true_type) noexcept
PskType type
std::integral_constant< bool, B > bool_constant
Definition: Traits.h:145
constexpr bool isLogLevelFatal(LogLevel level)
Definition: LogLevel.h:145

Helper macro for implementing FB_LOG() and FB_LOGF().

This macro generally should not be used directly by end users.

Definition at line 107 of file Logger.h.

#define FB_LOG_RAW (   logger,
  level,
  filename,
  linenumber,
  functionName,
  ... 
)
Value:
logger, \
level, \
filename, \
linenumber, \
functionName, \
##__VA_ARGS__)
#define FB_LOG_RAW_IMPL(logger, level, filename, line, functionName, type,...)
Definition: Logger.h:130

FB_LOG_RAW() can be used by callers that want to pass in the log level as a variable, and/or who want to explicitly specify the filename and line number.

This is useful for callers implementing their own log wrapper functions that want to pass in their caller's filename and line number rather than their own.

The log level parameter must be an explicitly qualified LogLevel value, or a LogLevel variable. (This differs from FB_LOG() and FB_LOGF() which accept an unqualified LogLevel name.)

Definition at line 75 of file Logger.h.

Referenced by TEST_F().

#define FB_LOG_RAW_IMPL (   logger,
  level,
  filename,
  line,
  functionName,
  type,
  ... 
)
Value:
(!(logger).getCategory()->logCheck(level)) \
? static_cast<void>(0) \
::folly::LogStreamProcessor{(logger).getCategory(), \
(level), \
(filename), \
(line), \
(functionName), \
(type), \
##__VA_ARGS__} \
.stream()
StreamCodecFactory stream
PskType type

Helper macro for implementing FB_LOG_RAW() and FB_LOGF_RAW().

This macro generally should not be used directly by end users.

This is very similar to FB_LOG_IMPL(), but since the level may be a variable instead of a compile-time constant, we cannot detect at compile time if this is a fatal log message or not.

Definition at line 130 of file Logger.h.

#define FB_LOGF (   logger,
  level,
  fmt,
  arg1,
  ... 
)
Value:
logger, \
::folly::LogLevel::level, \
fmt, \
arg1, \
##__VA_ARGS__)
#define FB_LOG_IMPL(logger, level, type,...)
Definition: Logger.h:107

Log a message to the specified logger, using a folly::format() string.

The arguments will be processed using folly::format(). The format syntax is similar to Python format strings.

This macro avoids evaluating the log arguments unless the log level check succeeds.

Beware that the logger argument is evaluated twice, so this argument should be an expression with no side-effects.

Definition at line 53 of file Logger.h.

Referenced by TEST_F().

#define FB_LOGF_RAW (   logger,
  level,
  filename,
  linenumber,
  functionName,
  fmt,
  arg1,
  ... 
)
Value:
logger, \
level, \
filename, \
linenumber, \
functionName, \
fmt, \
arg1, \
##__VA_ARGS__)
#define FB_LOG_RAW_IMPL(logger, level, filename, line, functionName, type,...)
Definition: Logger.h:130

FB_LOGF_RAW() is similar to FB_LOG_RAW(), but formats the log arguments using folly::format().

Definition at line 89 of file Logger.h.

Referenced by TEST_F().