Skip to content

Fix for .NET Core 3.1#3

Open
kostelis wants to merge 2 commits intoRedBearSys:masterfrom
kostelis:patch-1
Open

Fix for .NET Core 3.1#3
kostelis wants to merge 2 commits intoRedBearSys:masterfrom
kostelis:patch-1

Conversation

@kostelis
Copy link

FormattedLogValues are made internal and do not work anymore.

FormattedLogValues are made internal and do not work anymore.
Copy link

@siderisltd siderisltd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is better than the other solution with getting the Microsoft classes as it's not breaking the TState when you want to log model

Copy link

@siderisltd siderisltd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the usage of Microsoft.Extensions.Logging.Externals namespace used in the solution.

@kostas-jonauskas
Copy link

Where exactly? I cannot find where "Microsoft.Extensions.Logging.Externals" are used in the solution.

@siderisltd
Copy link

Sorry @kostas-baltsoft @kostelis, my bad - it's using Microsoft.Extensions.Logging.Internal; which is not longer available. You can see my commit where I added the original files initially. -> #5

Also in your method GetFirstValue - the field may be null so I strongly recommend you adding a null check. I've hit that while I was testing

From
var values = (object[])field.GetValue(lv);

To
var values = (object[])field?.GetValue(lv);

@cpwood can we merge his request once these changes are applied?

kostelis pushed a commit to kostelis/RedBear.LogDNA.Extensions.Logging that referenced this pull request Jan 14, 2022
@kostelis
Copy link
Author

Hey guys, sorry for a late reply. I have implemented a possible null reference check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants