def test_process_input_simple(self): input = InlineStringIO(""" woo yay this is a line booya """) logfile = StringIO.StringIO() monitors_util.process_input(input, logfile) input.seek(0) logfile.seek(0) self.assertEquals('%s\n%s\n' % (input.read(), monitors_util.TERM_MSG), logfile.read())
def test_process_input_simple(self): input = InlineStringIO(""" woo yay this is a line booya """) logfile = StringIO.StringIO() monitors_util.process_input(input, logfile) input.seek(0) logfile.seek(0) self.assertEquals( '%s\n%s\n' % (input.read(), monitors_util.TERM_MSG), logfile.read())
def main(): (options, args) = parser.parse_args() if len(args) != 2: parser.print_help() sys.exit(1) logfile = open(args[0], 'a', 0) warnfile = os.fdopen(int(args[1]), 'w', 0) # For now we aggregate all the alert_hooks. alert_hooks = [] for patterns_path in options.pattern_paths.split(','): alert_hooks.extend(monitors_util.build_alert_hooks_from_path( patterns_path, warnfile)) monitors_util.process_input( sys.stdin, logfile, options.log_timestamp_format, alert_hooks)
def main(): (options, args) = parser.parse_args() if len(args) != 2: parser.print_help() sys.exit(1) logfile = open(args[0], 'a', 0) warnfile = os.fdopen(int(args[1]), 'w', 0) # For now we aggregate all the alert_hooks. alert_hooks = [] for patterns_path in options.pattern_paths.split(','): alert_hooks.extend( monitors_util.build_alert_hooks_from_path(patterns_path, warnfile)) monitors_util.process_input(sys.stdin, logfile, options.log_timestamp_format, alert_hooks)