<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div><div>On Jan 24, 2011, at 1:18 PM, Jason J. W. Williams wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>In my opinion this has been a problem for a very long time, and it<br>would be better to have a correction that fits the majority of cases<br>with a small code change now rather than wait for the perfect log<br>system. These changes don't preclude a better logger and way of<br>filtering these out in the future. self.noisy may be viewed as a hack,<br>but honestly it's worked well for me and it's easy to understand what<br>it does.<br><br>If the compromise is the 4021 patch (wrapping with "if self.noisy"),<br>with noisy defaulting to True, I think that's a good solution today<br>without precluding the perfect solution when someone wants to build<br>it.<br></div></blockquote><div><br></div><div>While I agree with the general sentiment (incremental improvements that can be done now are pretty much always better than gigantic overhauls that have to be put off until later) the <i>current</i>&nbsp;logging system is already pretty much designed for this, we're just not <i>using</i>&nbsp;it right. &nbsp;Trimming JP's message a bit to just the key part:</div><div><br></div><div><blockquote type="cite"><div><blockquote type="cite">This doesn't even have to mean&nbsp;changes to LogPublisher. &nbsp;It could mean replacing:</blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">&nbsp;log.msg("%s starting on %s"%(self.protocol.__class__,<br></blockquote><blockquote type="cite">self._realPortNumber))<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">with:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">&nbsp;log.msg(<br></blockquote><blockquote type="cite">&nbsp; &nbsp; event_source=self,<br></blockquote><blockquote type="cite">&nbsp; &nbsp; event_type="start",<br></blockquote><blockquote type="cite">&nbsp; &nbsp; protocol=self.protocol,<br></blockquote><blockquote type="cite">&nbsp; &nbsp; port_number=self._realPortNumber)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">(and documenting and testing). &nbsp;It may well be nice to have LogPublisher be<br></blockquote><blockquote type="cite">able to dispatch these more efficiently, but that's just an optimization.</blockquote></div></blockquote></div><div><br></div><div>That is _literally_ all that needs to be done to preserve the functionality JP likes. &nbsp;You don't have to change the implementation of log.msg: it already accepts **kw, specifically for this reason. &nbsp;A message logged in this manner (with no "message" or "format" event key) will produce no text output in the log. &nbsp;So the amount of work involved is really just writing one line of code. &nbsp;Which JP already wrote, here. &nbsp;It just needs a unit test and a review :).</div><div><br></div><div>I do wonder why he went with the PEP8-style underscore parameter names rather than Twisted-style intercapped names though :).</div><div><br></div><div>-glyph</div><div><br></div><div>P.S.: In the future, please reply inline, it's standard etiquette for this list.</div><br></div><br></body></html>