From: Adam Simpkins Date: Tue, 28 Nov 2017 05:30:58 +0000 (-0800) Subject: logging: fix unused variable warning in non-debug builds X-Git-Tag: v2017.12.04.00~30 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=db13010c1338d471c713a652e0940afba627b8bc;p=folly.git 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 --- diff --git a/folly/experimental/logging/LogConfigParser.cpp b/folly/experimental/logging/LogConfigParser.cpp index 7e51472e..55244207 100644 --- a/folly/experimental/logging/LogConfigParser.cpp +++ b/folly/experimental/logging/LogConfigParser.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include using std::shared_ptr; @@ -330,7 +331,9 @@ LogConfig::CategoryConfigMap parseCategoryConfigs(StringPiece value) { auto emplaceResult = 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;