Changeset 21:bd11cd784102 in livinglogic.python.tipimaid

Show
Ignore:
Timestamp:
11/24/08 17:01:51 (10 years ago)
Author:
Nikolas Tautenhahn <nik@…>
Branch:
default
Message:

added commandline option for buffertime

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • liaalh.py

    r20 r21  
    122122    p = optparse.OptionParser(usage="usage: %prog filename-pattern [options]") 
    123123    p.add_option("-z", "--gzip", dest="gzip", type="int", action="store", help="If set, logs are gzipped with this compression level (lowest: 1, highest: 9)", default=None) 
     124    p.add_option("-b", "--buffertime", dest="buffertime", type="int", action="store", help="Time in seconds for which log entries are buffered, default=10", default=10) 
    124125    (options, args) = p.parse_args() 
    125126    if options.gzip is not None: 
     
    133134        sys.stderr.flush() 
    134135        return 1 
    135     buf = Buffer(pattern=args[0], gzip_logs=options.gzip, buffertime=300) 
     136    buf = Buffer(pattern=args[0], gzip_logs=options.gzip, buffertime=options.buffertime) 
    136137    signal.signal(signal.SIGHUP, buf.sighandler) 
    137138    signal.signal(signal.SIGTERM, buf.sighandler)