Skip to content

Commit

Permalink
Merge pull request #1 from e-salmon/LoggerScopeForConsole
Browse files Browse the repository at this point in the history
Add ToStirng override to CorrelatedLogScope
  • Loading branch information
e-salmon authored Sep 6, 2024
2 parents 23990a8 + 9f464e6 commit bfd4c1d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Correlate.Core/Extensions/LoggerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,14 @@ public KeyValuePair<string, object> this[int index]
throw new ArgumentOutOfRangeException(nameof(index));
}
}

/// <summary>
/// Returns a representation of the scope items as a list of comma-separated items,
/// matching the default representation provided by the standard Console logger.
/// </summary>
public override string ToString()
{
return string.Join(", ", this.Select(kv => $"{kv.Key}:{kv.Value}"));
}
}
}

0 comments on commit bfd4c1d

Please sign in to comment.