<s> import os <EOL> import sys <EOL> import time <EOL> import syslog <EOL> def _prefixed ( level , message ) : <EOL> now = time . strftime ( '<STR_LIT>' , time . localtime ( ) ) <EOL> return "<STR_LIT>" % ( now , level , os . getpid ( ) , message ) <EOL> syslog . openlog ( "<STR_LIT>" ) <EOL> counter = <NUM_LIT:0> <EOL> while True : <EOL> try : <EOL> line = sys . stdin . readline ( ) . strip ( ) <EOL> if line == "<STR_LIT>" : <EOL> counter += <NUM_LIT:1> <EOL> if counter > <NUM_LIT:100> : <EOL> break <EOL> continue <EOL> counter = <NUM_LIT:0> <EOL> syslog . syslog ( syslog . LOG_ALERT , _prefixed ( '<STR_LIT>' , line ) ) <EOL> except KeyboardInterrupt : <EOL> pass <EOL> except IOError : <EOL> pass </s>
