Skip to content

Commit

Permalink
changelog fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cijothomas committed Jul 29, 2021
1 parent 477674d commit 7cb48d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/OpenTelemetry/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* Removes upper constraint for Microsoft.Extensions.Logging
dependencies. ([#2179](https://github.com/open-telemetry/opentelemetry-dotnet/pull/2179))

* Fix bug which caused ILogger.Log calls to throw exception, when the
formatter supplied is null.
* OpenTelemetryLogger modified to not throw, when the
formatter supplied in ILogger.Log call is null. ([#2200](https://github.com/open-telemetry/opentelemetry-dotnet/pull/2200))

## 1.2.0-alpha1

Expand Down
11 changes: 1 addition & 10 deletions src/OpenTelemetry/Logs/OpenTelemetryLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,13 @@ public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Except
{
var options = this.provider.Options;

string formattedMessage = null;
if (options.IncludeFormattedMessage)
{
if (formatter != null)
{
formattedMessage = formatter(state, exception);
}
}

var record = new LogRecord(
options.IncludeScopes ? this.ScopeProvider : null,
DateTime.UtcNow,
this.categoryName,
logLevel,
eventId,
formattedMessage,
options.IncludeFormattedMessage ? formatter?.Invoke(state, exception) : null,
options.ParseStateValues ? null : (object)state,
exception,
options.ParseStateValues ? this.ParseState(state) : null);
Expand Down

0 comments on commit 7cb48d6

Please sign in to comment.