Quantcast
Channel: entityframework Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1793

New Post: SnubbingTheSnorkeling aka Interception logging

$
0
0
In reviewing worldlogsnorkellingchampion I wonder about the introduction of the TextWriter directly and LogParameter method. It seems to me a might-bit heavy-handed to be deciding the formatting of the log parameters being emitted, and dictating that they will be written to a TextWriter directly. This has an odor for me because:
  • The formatting is set-in-stone
  • There's some casting-about to get to scale and precision, which looks like an impedance-mismatch
  • We're forcing the logger to make the effort to write to TextWriter even if we might subsequently discard the output
I think we might want to introduce a minimal interface in place of the TextWriter (with default implementations that USE one) that exposes the LogCommand, LogParameter and LogResult methods and lets the current logger do the right thing... so I can have a null-logger that incurs essentially no overhead for all that string-conversion logic... but swap in a different logger (or a debug-level setting, or whatever) to enable it with no real changes.

Viewing all articles
Browse latest Browse all 1793

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>