Skip to content

Conversation

SimonCropp
Copy link
Contributor

needs a squash

@@ -281,7 +283,7 @@ bool TryConvertValueTuple(object value, Destructuring destructuring, Type valueT
return false;
}

bool TryConvertCompilerGeneratedType(object value, Destructuring destructuring, Type valueType, out LogEventPropertyValue result)
bool TryConvertCompilerGeneratedType(object value, Destructuring destructuring, Type valueType, [NotNullWhen(true)] out LogEventPropertyValue? result)
Copy link
Member

Choose a reason for hiding this comment

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

These are nicer to consume when they're written as:

[MaybeNullWhen(false)] out LogEventPropertyValue result

I.e. the out var is not nullable, and the compiler checks that the return value has been used. (This is how Dictionary<K,V> works when V is a non-nullable reference type.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but LogEventPropertyValue is a reference type, so it is not comparable to the Dictionary scenario?

Copy link
Member

Choose a reason for hiding this comment

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

That's a good question; I have a couple of things to check - will tinker and report back :-) 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

any outcome from the tinkering?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, hectic couple of weeks again! Starting to catch up but slow going :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no rush on my side, just making sure it hadnt slipped off your radar

Copy link
Member

Choose a reason for hiding this comment

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

Thanks :-) 👍

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for hanging in there, mate - I think your approach is the right one, squashing now!

@nblumhardt nblumhardt merged commit 697a231 into serilog:dev Aug 19, 2021
@nblumhardt nblumhardt mentioned this pull request Apr 23, 2022
Twinki14 pushed a commit to Twinki14/CitizenFX.Extensions.Client.Serilog that referenced this pull request Dec 30, 2023
* Update PropertyBinder.cs

* Update LoggerConfiguration.cs

* Update AggregateSink.cs

* Update ConditionalSink.cs

* Update DisposeDelegatingSink.cs

* Update DisposingAggregateSink.cs

* Update FilteringSink.cs

* Update RestrictedSink.cs

* Update SafeAggregateSink.cs

* Update SecondaryLoggerSink.cs

* Update LoggingLevelSwitch.cs

* Update PropertiesOutputFormat.cs

* Update JsonFormatter.cs

* Update JsonValueFormatterTests.cs

* Update Log.cs
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.

2 participants