projects
/
pgweb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f86bcb9
)
Add logfile argument to varnish consumer
author
Magnus Hagander
<magnus@hagander.net>
Fri, 12 Aug 2011 10:55:41 +0000
(12:55 +0200)
committer
Magnus Hagander
<magnus@hagander.net>
Fri, 12 Aug 2011 10:55:41 +0000
(12:55 +0200)
tools/pgq/varnish_consumer.py
patch
|
blob
|
blame
|
history
diff --git
a/tools/pgq/varnish_consumer.py
b/tools/pgq/varnish_consumer.py
index 2148b2599bd8030590203d35a661601eb80f90ec..ca6fa345498a0591170a0ac3bc45fa74d7afa65a 100755
(executable)
--- a/
tools/pgq/varnish_consumer.py
+++ b/
tools/pgq/varnish_consumer.py
@@
-135,6
+135,12
@@
if __name__=="__main__":
cp = ConfigParser()
cp.read('varnish_pgq.ini')
+ if len(sys.argv) > 2 and sys.argv[1] == "-logfile":
+ # Redirect to whatever is in sys.argv[2]
+ # (yes, this is a really ugly way of doing things..)
+ f = open(sys.argv[2], "w", 0)
+ sys.stdout = f
+
# Trap signals that shut us down, so we can kill off our subprocesses
# before we die.
signal.signal(signal.SIGTERM, sighandler)