You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But that is not the case and an exception is thrown (System.FormatException: 'Input string was not in a correct format.')
Reproduce
This behaver is reproducible and can be done by modifying a test with the below: _commonLogger.DebugFormat(templateString, arg);
replace with _commonLogger.Debug(m => m(templateString, arg));
Expectation
It should be expected when using the formatted log statement the result would be the same as when using the format message handler.
But that is not the case and an exception is thrown (System.FormatException: 'Input string was not in a correct format.')
Reproduce
This behaver is reproducible and can be done by modifying a test with the below:
_commonLogger.DebugFormat(templateString, arg);
replace with
_commonLogger.Debug(m => m(templateString, arg));
The test in question can be found here: https://github.com/ChangemakerStudios/Common.Logging.Serilog/blob/master/Common.Logging.Serilog.Tests/SerilogCommonLoggerTests.cs#L71
The test will fail with the following
Possible fix
Fixing this seems to be removing the below line
string formatted = string.Format(formatProvider, message, parameters);
found at
https://github.com/ChangemakerStudios/Common.Logging.Serilog/blob/master/src/SerilogCommonLogger.cs#L561
Outro
Last release from this project is some time ago, but I hope, my message will be seen and a fixed can be created.
Best regards
The text was updated successfully, but these errors were encountered: