Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Tweak.
  • Loading branch information
CodeBlanch committed Mar 30, 2023
commit c25e48f9f529c9f21518b2a4c7993236092bd300
8 changes: 5 additions & 3 deletions src/OpenTelemetry/Logs/OpenTelemetryLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Except
LogRecordData.SetActivityContext(ref data, activity);

var attributes = record.Attributes = provider.IncludeState
? ProcessState(record, ref iloggerData, state, provider.ParseStateValues)
? ProcessState(record, ref iloggerData, in state, provider.ParseStateValues)
: null;

if (!TryGetOriginalFormatFromAttributes(attributes, out var originalFormat))
Expand Down Expand Up @@ -117,7 +117,7 @@ public bool IsEnabled(LogLevel logLevel)
private static IReadOnlyList<KeyValuePair<string, object?>>? ProcessState<TState>(
LogRecord logRecord,
ref LogRecord.LogRecordILoggerData iLoggerData,
TState state,
in TState state,
bool parseStateValues)
{
iLoggerData.State = null;
Expand Down Expand Up @@ -188,7 +188,9 @@ public bool IsEnabled(LogLevel logLevel)
}
}

private static bool TryGetOriginalFormatFromAttributes(IReadOnlyList<KeyValuePair<string, object?>>? attributes, [NotNullWhen(true)] out string? originalFormat)
private static bool TryGetOriginalFormatFromAttributes(
IReadOnlyList<KeyValuePair<string, object?>>? attributes,
[NotNullWhen(true)] out string? originalFormat)
{
if (attributes != null && attributes.Count > 0)
{
Expand Down