New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Natively support JSON.NET dynamic objects (JObject) #30
Comments
I was trying to get this working via Cursory look through the codebase seems to indicate (here https://github.com/serilog/serilog/blob/master/src/Serilog/Parameters/PropertyValueConverter.cs?source=c#L112) that I think perhaps giving the |
I created a quick workaround for now by... adding a level of indirection. I added a class called |
@kkozmic how's this one turning out? Worth us removing the limitation you mention above? Any other thoughts? Cheers :) |
well, it's a nasty workaround :) It gets me where I need to be but I'd rather have a more elegant solution than that if possible. |
New interface, perhaps? public interface ISequenceConversionPolicy
{
bool TryConvertToSequence(object value, ILogEventPropertyValueFactory propertyValueFactory, out SequenceValue result);
} Also, maybe: public interface IDictionaryConversionPolicy :) |
Closing for now, but open to working through this one if anyone's keen to try a PR. Thanks for all the input folks! :) |
@kkozmic Any chance I could take a look at your |
Sorry, I don't have that code with me anymore. On Tue Feb 03 2015 at 4:38:45 AM Harry McIntyre notifications@github.com
|
#371 echoes this one, I think it's one for us to reopen, but might be a "2.0" |
… run before IEnumerable cast -- allowing an opportunity for policies to support IEnumerable values. Added IsValueTypeDictionary function to simplify the look of the dictionary conversion code.
Build 1.4.168 removes the limitation that made this awkward; would love to see a Serilog.Extras.JObject or similar that takes advantage of it :-) Thanks @Jaben for nailing this! |
Nice! |
@nblumhardt that's awesome, thanks! |
On Twitter you mentioned that it should be fairly straightforward to implement via IDestructuringPolicy
;)
The text was updated successfully, but these errors were encountered: