Copilot commented on code in PR #12917:
URL: https://github.com/apache/trafficserver/pull/12917#discussion_r2895248531


##########
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:
   Logging overrides via `errata.note(ERRATA_DEBUG, ...)` means 
`ParseRecordsFromYAML()` will return a non-empty `swoc::Errata` even when there 
are no actual issues, and `RecCoreInit()` will then emit the "We have found the 
following issues..." warning at startup. With runroot active, the 
runroot-managed path records will always trigger this, producing warning-level 
noise on every startup. Consider logging overrides via `RecDebug` (tag `rec`) 
or adjusting the aggregation/reporting so only WARN+ severities trigger the 
startup warning.



-- 
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]

Reply via email to