<div class="gmail_quote">On Tue, Nov 15, 2011 at 11:36 AM, Jeffrey Ollie <span dir="ltr"><<a href="mailto:jeff@ocjtech.us">jeff@ocjtech.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I'm using twisted.python.log to do some logging in an application.<br>
It's formatting the output like "<date> [-] <mymessage>". I've seen<br>
in some of my other applications that the contents of "[-]" can change<br>
depending on how the code is reached. Is there a way that I can<br>
customize this in my application? I'd like to change the contents to<br>
reflect the particular object that is generating the log message.<br>
<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>If you pass a 'system' kwarg to log.msg then it will go in that field.</div><div><br></div><div>log.msg("hi", system="stuff") results in <date> [stuff] hi</div>
<div><br></div><div>In my applications I usually hack the default log context stuff to disable the inferred systems because they end up just being misleading and inconsistent anyway.</div><div><br></div><div> </div></div>
-- <br>Christopher Armstrong<br><a href="http://radix.twistedmatrix.com/">http://radix.twistedmatrix.com/</a><br><a href="http://planet-if.com/">http://planet-if.com/</a><br><br><br>