logging: update LoggerDB::get() to return a reference

Summary:
Change `LoggerDB::get()` to a reference instead of a pointer since this
function can never return null.

Reviewed By: yfeldblum

Differential Revision: D6893206

fbshipit-source-id: af47063918a79c851fd39b838d6c63755166e033
This commit is contained in:
Adam Simpkins 2018-02-06 12:42:13 -08:00 committed by Facebook Github Bot
parent b5c47a9ed7
commit 4fb0ac3809
2 changed files with 3 additions and 3 deletions

View File

@ -61,7 +61,7 @@ void PrivHelperServer::initLogging() {
// Initialize the folly logging code for use inside the privhelper process.
// For simplicity and safety we always use a fixed logging configuration here
// rather than parsing a more complex full logging configuration string.
auto* rootCategory = folly::LoggerDB::get()->getCategory(".");
auto* rootCategory = folly::LoggerDB::get().getCategory(".");
// We always use a non-async file writer, rather than the threaded async
// writer.

View File

@ -575,8 +575,8 @@ void EdenServiceHandler::debugSetLogLevel(
inherit = false;
}
auto db = folly::LoggerDB::get();
result.categoryCreated = !db->getCategoryOrNull(*category);
auto& db = folly::LoggerDB::get();
result.categoryCreated = !db.getCategoryOrNull(*category);
folly::Logger(*category).getCategory()->setLevel(
folly::stringToLogLevel(*level), inherit);
}