Popular recipes tagged "log" but not "directory"http://code.activestate.com/recipes/tags/log-directory/2014-04-04T15:54:03-07:00ActiveState Code RecipesLog watcher (tail -F *.log) (Python)
2014-04-04T15:54:03-07:00Giampaolo RodolĂ http://code.activestate.com/recipes/users/4178764/http://code.activestate.com/recipes/577968-log-watcher-tail-f-log/
<p style="color: grey">
Python
recipe 577968
by <a href="/recipes/users/4178764/">Giampaolo RodolĂ </a>
(<a href="/recipes/tags/color/">color</a>, <a href="/recipes/tags/log/">log</a>, <a href="/recipes/tags/logging/">logging</a>, <a href="/recipes/tags/monitor/">monitor</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/rotate/">rotate</a>, <a href="/recipes/tags/rotations/">rotations</a>, <a href="/recipes/tags/tail/">tail</a>).
Revision 10.
</p>
<p>A python class which "watches" a directory and calls a callback(filename, lines) function every time one of the files being watched gets written, in real time.</p>
<p>Practically speaking, this can be compared to <em>"tail -F *.log"</em> UNIX command, but instead of having lines printed to stdout a python function gets called.</p>
<p>Similarly to tail, it takes care of "watching" new files which are created after initialization and "unwatching" those ones which are removed in the meantime. This means you'll be able to "follow" and support also rotating log files.</p>
<p><strong>History</strong></p>
<ul>
<li>rev5 (2013-04-05):
<ul>
<li>sizehint parameter</li>
</ul></li>
<li>rev4 (2013-03-16):
<ul>
<li>python 3 support (also dropped support for python <= 2.5)</li>
<li>windows support</li>
<li>unit tests</li>
<li>main class can also be used as a context manager</li>
</ul></li>
<li>rev3 (2012-01-13): initial release</li>
</ul>
Linux cat command backward (Python)
2011-05-18T12:54:15-07:00Andrey Nikishaevhttp://code.activestate.com/recipes/users/4176176/http://code.activestate.com/recipes/577699-linux-cat-command-backward/
<p style="color: grey">
Python
recipe 577699
by <a href="/recipes/users/4176176/">Andrey Nikishaev</a>
(<a href="/recipes/tags/cat/">cat</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/log/">log</a>, <a href="/recipes/tags/output/">output</a>).
Revision 2.
</p>
<p>Utility to output file from backward. Useful for logs output.</p>
tgraph - Simple ASCII graphing utility (Python)
2011-07-28T21:13:23-07:00Drew Gulinohttp://code.activestate.com/recipes/users/4119417/http://code.activestate.com/recipes/577077-tgraph-simple-ascii-graphing-utility/
<p style="color: grey">
Python
recipe 577077
by <a href="/recipes/users/4119417/">Drew Gulino</a>
(<a href="/recipes/tags/ascii/">ascii</a>, <a href="/recipes/tags/graph/">graph</a>, <a href="/recipes/tags/log/">log</a>, <a href="/recipes/tags/sysadmin/">sysadmin</a>, <a href="/recipes/tags/tail/">tail</a>, <a href="/recipes/tags/unix/">unix</a>).
</p>
<p>Takes a stream of numbers and outputs simple ASCII graphs of those numbers</p>