import logging
import logging.handlers
import os
-from sys import stdin, version
+from sys import exit, stdin, version
from subprocess import check_output
from datetime import datetime
# Set up parsers
loader = load_parsers.ParserLoader()
+
+ try:
+ loader.check_systemd()
+ except Exception as e:
+ logger.error("Failed to check systemd dependencies: ".format(e))
+
if parser_names:
for parser_name in parser_names:
if parser_name not in ignore_logs:
# Execute parsers
+ executed_parsers = []
+
for parser in loader.parsers:
- output.append_section(parser.parse_log())
+ if (argparser.parse_args().verbose
+ or config.prefs.getboolean("logparse", "verbose")):
+ output.append_section(parser.parse_log())
+
+ else:
+ try:
+ output.append_section(parser.parse_log())
+ except Exception as e:
+ logger.error("Uncaught error executing logger {0}: {1}".format(
+ parser.name, e))
+ executed_parsers.append(parser.name)
+
+ if len(executed_parsers) == 0:
+ exit()
# Write footer
output.append_footer()
return
+
def get_argparser():
"""
Initialise arguments (in a separate function for documentation purposes)