TraceSourceLogger now takes exception into account(adds it to the log… (#42571)
authorrizi <rizi@users.noreply.github.com>
Mon, 28 Sep 2020 17:54:42 +0000 (19:54 +0200)
committerGitHub <noreply@github.com>
Mon, 28 Sep 2020 17:54:42 +0000 (10:54 -0700)
commit5cb5ae9f33837ec63e1a444f5d8a3f64d2d7188b
tree9d3d24228c7d538ef0ebed06c64f4d4aa4048c3f
parent1ea8eb16c7f5d90160e6f58a1bf8230dee73ea55
TraceSourceLogger now takes exception into account(adds it to the log… (#42571)

* TraceSourceLogger now takes exception into account(adds it to the log message) even if formatter is not null

* Fixed a logical error, that would have added the exception twice to the log message when the formatter would have been null.

* Added tests for TraceSourceLogger.

* Removed unnecessary white-spaces.

* Make the TraceLogger output more "natural" (one line message)  and similar to SystemdConsoleFormatter.

* Update TraceSourceLoggerTest.cs

* Update TraceSourceLoggerTest.cs

Co-authored-by: Maryam Ariyan <maryam.ariyan@microsoft.com>
src/libraries/Microsoft.Extensions.Logging.TraceSource/src/TraceSourceLogger.cs
src/libraries/Microsoft.Extensions.Logging/tests/Common/TraceSourceLoggerTest.cs