Skip to content

Commit

Permalink
Ensure warning message uses local time
Browse files Browse the repository at this point in the history
Fixes #9279

When incremental build failure detection is enabled, we can log a warning that includes paths and timestamps. However if FUTDC logging is disabled, the conversion from UTC to local time could be bypassed, making the log message harder to understand and potentially misleading (as there's no mention of UTC in the message).

This change fixes that issue by ensuring any times are converted to local time prior to being displayed.
  • Loading branch information
drewnoakes committed Oct 11, 2023
1 parent d0efb44 commit addd3c3
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ public bool Fail(string reason, string resourceName, params object[] values)
});

// Remember the failure reason and description for use in IncrementalBuildFailureDetector.
// First, ensure times are converted to local time (in case logging is not enabled).
ConvertToLocalTimes(values);
FailureReason = reason;
FailureDescription = string.Format(GetResourceString(resourceName), values);

Expand Down

0 comments on commit addd3c3

Please sign in to comment.