summaryrefslogtreecommitdiff
path: root/example.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2011-05-13 19:10:42 +0100
committerLars Wirzenius <liw@liw.fi>2011-05-13 19:10:42 +0100
commit9cda9656a25c9983fa8666c5d2b7e1544cb3d07b (patch)
tree1fb3e4128f67cda55870e60d480ab16dee9c0b55 /example.py
parentdd0f867527349d078cd584cc8f1df6cecd07ebd1 (diff)
downloadcliapp-9cda9656a25c9983fa8666c5d2b7e1544cb3d07b.tar.gz
Improve default logging format.
Also add a log statement to the example so we can easily test things.
Diffstat (limited to 'example.py')
-rw-r--r--example.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/example.py b/example.py
index 3849442..93b1059 100644
--- a/example.py
+++ b/example.py
@@ -22,6 +22,7 @@ This implements an fgrep-like utility.
import cliapp
+import logging
class ExampleApp(cliapp.Application):
@@ -45,6 +46,7 @@ class ExampleApp(cliapp.Application):
if pattern in line:
self.output.write('%s:%s: %s' % (name, self.lineno, line))
self.matches += 1
+ logging.debug('Match: %s line %d' % (name, self.lineno))
app = ExampleApp(version='0.1.2')