-
Notifications
You must be signed in to change notification settings - Fork 1
Add ICombinedSettingsBuilder.Dump()
and ICombinedSettingsBuilder.DumpToSelfLog()
#11
Conversation
d0fee2d
to
6b181d2
Compare
Looks great! Only a thought - perhaps |
Yep, Maybe The |
To inspect the currently defined key-value settings and help when debugging settings related issues
6b181d2
to
4aa74ca
Compare
ICombinedSettingsBuilder.Dump()
and ICombinedSettingsBuilder.DumpToSelfLog()
ICombinedSettingsBuilder.Dump()
and ICombinedSettingsBuilder.DumpToSelfLog()
Not sure if it's a useful suggestion .. but we could always just include |
agreed :) |
59e7781
to
74f91e7
Compare
I've done the change. There is now only |
} | ||
else | ||
{ | ||
SelfLog.WriteLine($"{nameof(Inspect)} called on a {nameof(ICombinedSettingsBuilder)} that is not a {nameof(CombinedSettingsBuilder)}. Cannot dump the key-value pairs. Concrete type is {self.GetType()}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thought, do we need the interface here, or would just using the concrete type throughout eliminate this type of issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean getting rid of the ICombinedSettingsBuilder
interface all together ? That would mean making the concrete calss CombinedSettingsBuilder
public and sealed
too, I guess ... I don't have strong opinions on that, just that using interfaces seemed more pure when doing fluent-interface-y stuff :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and make the constructor internal
also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was the gist of what I had in mind, but could be pros/cons. Classes and/or ABCs do generally evolve a bit better (it's not a breaking change to add a method, for example), but could be other reasons to prefer an interface here - just an idea :-)
Following your suggestions, I got rid of It's probably paranoia talking, but I have :
I believe it will still be OK to unlock it later on if we need to :) |
Paranoia is welcome here :-) |
To inspect the currently defined key-value settings and help when debugging settings related issues.
Those extension methods are in the
Serilog.Debugging
namespace.Note: this PR sits on top of #10 , so I will rebase it properly once #10 has been merged .