From 22e37d8857381a2450de40fc50b7bab8d13af9fa Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Tue, 2 Feb 2021 15:36:16 +0100 Subject: [PATCH] Don't log a message that a field is missing if the field trial key starts with "_" Bug: None Change-Id: I6967e8a43ce762e2c272ca9c25e359f23eaf2157 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205003 Commit-Queue: Ying Wang Reviewed-by: Sebastian Jansson Cr-Commit-Position: refs/heads/master@{#33143} --- rtc_base/experiments/field_trial_parser.cc | 5 ++++- rtc_base/experiments/struct_parameters_parser.cc | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/rtc_base/experiments/field_trial_parser.cc b/rtc_base/experiments/field_trial_parser.cc index b88d0f97c4..8fc89cec8f 100644 --- a/rtc_base/experiments/field_trial_parser.cc +++ b/rtc_base/experiments/field_trial_parser.cc @@ -83,7 +83,10 @@ void ParseFieldTrial( RTC_LOG(LS_WARNING) << "Failed to read empty key field with value '" << key << "' in trial: \"" << trial_string << "\""; } - } else { + } else if (key.empty() || key[0] != '_') { + // "_" is be used to prefix keys that are part of the string for + // debugging purposes but not neccessarily used. + // e.g. WebRTC-Experiment/param: value, _DebuggingString RTC_LOG(LS_INFO) << "No field with key: '" << key << "' (found in trial: \"" << trial_string << "\")"; std::string valid_keys; diff --git a/rtc_base/experiments/struct_parameters_parser.cc b/rtc_base/experiments/struct_parameters_parser.cc index 2605da8fef..d62eb6f1ea 100644 --- a/rtc_base/experiments/struct_parameters_parser.cc +++ b/rtc_base/experiments/struct_parameters_parser.cc @@ -107,7 +107,10 @@ void StructParametersParser::Parse(absl::string_view src) { break; } } - if (!found) { + // "_" is be used to prefix keys that are part of the string for + // debugging purposes but not neccessarily used. + // e.g. WebRTC-Experiment/param: value, _DebuggingString + if (!found && (key.empty() || key[0] != '_')) { RTC_LOG(LS_INFO) << "No field with key: '" << key << "' (found in trial: \"" << src << "\")"; }