Index: third_party/re2/re2/filtered_re2.cc |
diff --git a/third_party/re2/re2/filtered_re2.cc b/third_party/re2/re2/filtered_re2.cc |
index 9269cee105826e605ec181f8cbe6b45b81ee3d26..f57625895e471978d2b61e28f4f1be133ea2dd07 100644 |
--- a/third_party/re2/re2/filtered_re2.cc |
+++ b/third_party/re2/re2/filtered_re2.cc |
@@ -27,8 +27,10 @@ RE2::ErrorCode FilteredRE2::Add(const StringPiece& pattern, |
RE2::ErrorCode code = re->error_code(); |
if (!re->ok()) { |
- LOG(ERROR) << "Couldn't compile regular expression, skipping: " |
- << re << " due to error " << re->error(); |
+ if (options.log_errors()) { |
+ LOG(ERROR) << "Couldn't compile regular expression, skipping: " |
+ << re << " due to error " << re->error(); |
+ } |
delete re; |
} else { |
*id = re2_vec_.size(); |