I&#39;m looking to make some changes to the way a <a href="http://twistedmatrix.com/projects/core/documentation/howto/plugin.html">twistd plugin</a> logs information. The docs on <a href="http://twistedmatrix.com/projects/core/documentation/howto/logging.html">logging</a> and the <a href="http://twistedmatrix.com/projects/core/documentation/howto/application.html#auto6">application framework</a> don&#39;t currently mention how plugins fit in.<br>

<br>My main goal is to have the log include information about the log level of each message represented as either text or an integer (like logging.DEBUG, etc). This would make log monitoring tools and alerts much more accurate as well as easier to write. I&#39;d also like to be able to call log methods for each level (log.debug(), log.error(), etc) instead of only having log.msg().<br>

<br>For example, I&#39;d prefer to turn:<br><span style="font-family: courier new,monospace;">2009-06-12 13:04:12-0700 [-] Foo service starting</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">2009-06-12 13:04:12-0700 [-] Loaded config from /etc/foo/</span><span style="font-family: courier new,monospace;">missing</span><span style="font-family: courier new,monospace;">.cfg</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">2009-06-12 13:04:12-0700 [-] Log file does not exist: /etc/foo/</span><span style="font-family: courier new,monospace;">missing</span><span style="font-family: courier new,monospace;">.cfg</span><br>


into something like:<br><span style="font-family: courier new,monospace;">20|2009-06-12 13:04:12|Foo service starting</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">10|2009-06-12 13:04:12|Loaded config from /etc/foo/missing.cfg</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">50|2009-06-12 13:04:12|Log file does not exist: /etc/foo/</span><span style="font-family: courier new,monospace;">missing</span><span style="font-family: courier new,monospace;">.cfg</span><br>

<br>(10 = logging.DEBUG, 20 = logging.INFO, 50 = logging.CRITICAL from <a href="http://docs.python.org/library/logging.html">Python&#39;s logging module</a>)<br>
<br>I&#39;ve looked through most of the current logging code but I&#39;m new to both Python and Twisted and am not sure if adding what I want through subclassing is the best approach or even a possibility.<br><br>Thanks!<br>