Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
fix tag shadowing (#3388)
Browse files Browse the repository at this point in the history
Co-authored-by: stas <statis@microsoft.com>
  • Loading branch information
stishkin and stas authored Aug 4, 2023
1 parent c6b9147 commit d464e34
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ApiService/ApiService/Log.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ private static SeverityLevel GetSeverityLevel(LogLevel logLevel) {
/// <param name="eventId">Event Id information.</param>
private void PopulateTelemetry<TState>(ISupportProperties telemetryItem, TState state, EventId eventId) {
IDictionary<string, string> dict = telemetryItem.Properties;

PopulateTags(telemetryItem);

dict["CategoryName"] = this.categoryName;
dict["Logger"] = nameof(OneFuzzLogger);

Expand All @@ -181,11 +184,15 @@ private void PopulateTelemetry<TState>(ISupportProperties telemetryItem, TState
if (string.Equals(item.Key, "{OriginalFormat}")) {
dict["OriginalFormat"] = Convert.ToString(item.Value, CultureInfo.InvariantCulture) ?? $"Failed to convert {item.Value}";
} else {
//if there is an existing tag that is shadowing the log message tag - rename it
if (dict.ContainsKey(item.Key)) {
dict[$"!@#<--- {item.Key} --->#@!"] = dict[item.Key];
}
dict[item.Key] = Convert.ToString(item.Value, CultureInfo.InvariantCulture) ?? $"Failed to convert {item.Value}";
}
}
}
PopulateTags(telemetryItem);

}

/// <param name="telemetryItem"></param>
Expand Down

0 comments on commit d464e34

Please sign in to comment.