brbzull0 commented on code in PR #12917:
URL: https://github.com/apache/trafficserver/pull/12917#discussion_r2895617026
##########
src/records/RecYAMLDecoder.cc:
##########
@@ -156,11 +156,12 @@ SetRecordFromYAMLNode(CfgNode const &field, swoc::Errata
&errata)
std::string field_value = field.value_node.as<std::string>(); // in case of
a string, the library will give us the literal
// 'null'
which is exactly what we want.
- std::string value_str =
RecConfigOverrideFromEnvironment(record_name.c_str(), field_value.c_str());
- RecSourceT source = (field_value == value_str ? REC_SOURCE_EXPLICIT :
REC_SOURCE_ENV);
+ auto [value_str, override_source] =
RecConfigOverrideFromEnvironment(record_name.c_str(), field_value.c_str());
+ RecSourceT source = (override_source ==
RecConfigOverrideSource::NONE) ? REC_SOURCE_EXPLICIT : REC_SOURCE_ENV;
- if (source == REC_SOURCE_ENV) {
- errata.note(ERRATA_DEBUG, "'{}' was override with '{}' using an env
variable", record_name, value_str);
+ if (override_source != RecConfigOverrideSource::NONE) {
+ errata.note(ERRATA_DEBUG, "'{}' overridden with '{}' by {}", record_name,
value_str,
+ RecConfigOverrideSourceName(override_source));
}
Review Comment:
The errata is the single structured channel for everything that happens
during YAML parsing(overrides, defaults, warnings) each carrying its own
severity.
The logging message can be changed a bit eventually. Not the scope of this
PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]