From: Jason Ish Date: Mon, 20 Jul 2020 16:39:37 +0000 (-0600) Subject: classifications: logging fixups X-Git-Tag: 1.2.0rc1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7c4e5401ce7d0074662cda3ad58f70e6b238ddd;p=thirdparty%2Fsuricata-update.git classifications: logging fixups Log when loading a classification file as debug. Log the path being written as info. --- diff --git a/suricata/update/main.py b/suricata/update/main.py index 3aad65a..746bc1b 100644 --- a/suricata/update/main.py +++ b/suricata/update/main.py @@ -368,6 +368,7 @@ def load_classification(suriconf, files): for path in dirs: if os.path.exists(path): + logger.debug("Loading {}".format(path)) with open(path) as fp: for line in fp: if line.startswith("#") or not line.strip(): @@ -381,7 +382,7 @@ def load_classification(suriconf, files): # Handle files from the sources for filep in files: - logger.info("Loading {}".format(filep[0])) + logger.debug("Loading {}".format(filep[0])) lines = filep[1].decode().split('\n') for line in lines: if line.startswith("#") or not line.strip(): @@ -407,6 +408,7 @@ def manage_classification(suriconf, files): classification_dict = load_classification(suriconf, files) path = os.path.join(config.get_output_dir(), "classification.config") try: + logger.info("Writing {}".format(path)) with open(path, "w+") as fp: fp.writelines("{}\n".format(v[2]) for k, v in classification_dict.items()) except (OSError, IOError) as err: