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

logging: fix unused variable warning in non-debug builds

Summary:
Use FOLLY_SAFE_DCHECK() rather than assert() to avoid compiler errors about
this variable being unused in builds where assert() statements are disabled.

Reviewed By: bolinfest, yfeldblum

Differential Revision: D6421978

fbshipit-source-id: ab1019fa1fa420856e1bf3bc39c441662c4efd75
parent 2fef5f70
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <folly/dynamic.h> #include <folly/dynamic.h>
#include <folly/experimental/logging/LogName.h> #include <folly/experimental/logging/LogName.h>
#include <folly/json.h> #include <folly/json.h>
#include <folly/lang/SafeAssert.h>
#include <cassert> #include <cassert>
using std::shared_ptr; using std::shared_ptr;
...@@ -330,7 +331,9 @@ LogConfig::CategoryConfigMap parseCategoryConfigs(StringPiece value) { ...@@ -330,7 +331,9 @@ LogConfig::CategoryConfigMap parseCategoryConfigs(StringPiece value) {
auto emplaceResult = auto emplaceResult =
categoryConfigs.emplace(canonicalName, std::move(categoryConfig)); categoryConfigs.emplace(canonicalName, std::move(categoryConfig));
assert(emplaceResult.second); FOLLY_SAFE_DCHECK(
emplaceResult.second,
"category name must be new since it was not in seenCategories");
} }
return categoryConfigs; return categoryConfigs;
......
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