From 63f3de47b7f69956527ca07bb3972a2c9fc103b3 Mon Sep 17 00:00:00 2001 From: Hemna Date: Wed, 24 Apr 2024 13:57:24 -0400 Subject: [PATCH] Added config enable_packet_logging If you want to disable the logging of packets to the log file, set this new common config option to False --- aprsd/conf/common.py | 5 +++++ aprsd/packets/log.py | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/aprsd/conf/common.py b/aprsd/conf/common.py index 4a8904e..89725b4 100644 --- a/aprsd/conf/common.py +++ b/aprsd/conf/common.py @@ -131,6 +131,11 @@ aprsd_opts = [ help="Enable the Callsign seen list tracking feature. This allows aprsd to keep track of " "callsigns that have been seen and when they were last seen.", ), + cfg.BoolOpt( + "enable_packet_logging", + default=True, + help="Set this to False, to disable logging of packets to the log file.", + ), ] watch_list_opts = [ diff --git a/aprsd/packets/log.py b/aprsd/packets/log.py index 9951331..88b63a0 100644 --- a/aprsd/packets/log.py +++ b/aprsd/packets/log.py @@ -20,6 +20,8 @@ PACKET_COLOR = "cyan" def log_multiline(packet, tx: Optional[bool] = False, header: Optional[bool] = True) -> None: """LOG a packet to the logfile.""" + if not CONF.enable_packet_logging: + return if CONF.log_packet_format == "compact": return @@ -79,6 +81,8 @@ def log_multiline(packet, tx: Optional[bool] = False, header: Optional[bool] = T def log(packet, tx: Optional[bool] = False, header: Optional[bool] = True) -> None: + if not CONF.enable_packet_logging: + return if CONF.log_packet_format == "multiline": log_multiline(packet, tx, header) return