Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documentation and example of the Python API
- Loading branch information
Julien Palard
committed
Aug 10, 2013
1 parent
b0b5343
commit d347e0a
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env python | ||
|
||
import pprint | ||
import sys | ||
sys.path.append('..') | ||
|
||
from logtop import logtop | ||
|
||
|
||
""" | ||
This example show a complete usage of the python API, | ||
It can be used like this : | ||
$ make python-module | ||
$ cat /etc/passwd | cut -d: -f7 | python example1.py | ||
""" | ||
|
||
l = logtop(10000) | ||
for line in sys.stdin: | ||
l.feed(line) | ||
|
||
pprint.pprint(l.get(10)) |