diff --git a/folly/logging/LoggerDB.h b/folly/logging/LoggerDB.h index 5ab0c46ca75..11c46f94056 100644 --- a/folly/logging/LoggerDB.h +++ b/folly/logging/LoggerDB.h @@ -57,7 +57,7 @@ class LoggerDB { * This creates the LogCategory for the specified name if it does not exist * already. */ - LogCategory* getCategory(folly::StringPiece name); + LogCategory* FOLLY_NONNULL getCategory(folly::StringPiece name); /** * Get the LogCategory for the specified name, if it already exists. @@ -80,7 +80,10 @@ class LoggerDB { * use a less verbose level than its parent categories.) */ void setLevel(folly::StringPiece name, LogLevel level, bool inherit = true); - void setLevel(LogCategory* category, LogLevel level, bool inherit = true); + void setLevel( + LogCategory* FOLLY_NONNULL category, + LogLevel level, + bool inherit = true); /** * Get a LogConfig object describing the current state of the LoggerDB. @@ -170,12 +173,12 @@ class LoggerDB { */ LogLevel xlogInit( folly::StringPiece categoryName, - std::atomic* xlogCategoryLevel, - LogCategory** xlogCategory); - LogCategory* xlogInitCategory( + std::atomic* FOLLY_NONNULL xlogCategoryLevel, + LogCategory* FOLLY_NULLABLE * FOLLY_NULLABLE xlogCategory); + LogCategory* FOLLY_NONNULL xlogInitCategory( folly::StringPiece categoryName, - LogCategory** xlogCategory, - std::atomic* isInitialized); + LogCategory* FOLLY_NONNULL * FOLLY_NONNULL xlogCategory, + std::atomic* FOLLY_NONNULL isInitialized); enum TestConstructorArg { TESTING }; @@ -240,7 +243,8 @@ class LoggerDB { * Windows, and prints the message to stderr on other platforms. It also * rate limits messages if they are arriving too quickly. */ - static void setInternalWarningHandler(InternalWarningHandler handler); + static void setInternalWarningHandler( + InternalWarningHandler FOLLY_NULLABLE handler); private: using LoggerNameMap = std::unordered_map< @@ -274,12 +278,12 @@ class LoggerDB { LoggerDB& operator=(LoggerDB const&) = delete; LoggerDB(); - LogCategory* getOrCreateCategoryLocked( + LogCategory* FOLLY_NONNULL getOrCreateCategoryLocked( LoggerNameMap& loggersByName, folly::StringPiece name); - LogCategory* createCategoryLocked( + LogCategory* FOLLY_NONNULL createCategoryLocked( LoggerNameMap& loggersByName, folly::StringPiece name, - LogCategory* parent); + LogCategory* FOLLY_NONNULL parent); using NewHandlerMap = std::unordered_map>; @@ -289,12 +293,12 @@ class LoggerDB { void startConfigUpdate( const Synchronized::LockedPtr& handlerInfo, const LogConfig& config, - NewHandlerMap* handlers, - OldToNewHandlerMap* oldToNewHandlerMap); + NewHandlerMap* FOLLY_NONNULL handlers, + OldToNewHandlerMap* FOLLY_NONNULL oldToNewHandlerMap); void finishConfigUpdate( const Synchronized::LockedPtr& handlerInfo, - NewHandlerMap* handlers, - OldToNewHandlerMap* oldToNewHandlerMap); + NewHandlerMap* FOLLY_NONNULL handlers, + OldToNewHandlerMap* FOLLY_NONNULL oldToNewHandlerMap); std::vector> buildCategoryHandlerList( const NewHandlerMap& handlerMap, StringPiece categoryName,