mirror of
https://github.com/craigerl/aprsd.git
synced 2024-12-21 09:01:23 -05:00
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
This commit is contained in:
parent
c206f52a76
commit
63f3de47b7
@ -131,6 +131,11 @@ aprsd_opts = [
|
|||||||
help="Enable the Callsign seen list tracking feature. This allows aprsd to keep track of "
|
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.",
|
"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 = [
|
watch_list_opts = [
|
||||||
|
@ -20,6 +20,8 @@ PACKET_COLOR = "cyan"
|
|||||||
|
|
||||||
def log_multiline(packet, tx: Optional[bool] = False, header: Optional[bool] = True) -> None:
|
def log_multiline(packet, tx: Optional[bool] = False, header: Optional[bool] = True) -> None:
|
||||||
"""LOG a packet to the logfile."""
|
"""LOG a packet to the logfile."""
|
||||||
|
if not CONF.enable_packet_logging:
|
||||||
|
return
|
||||||
if CONF.log_packet_format == "compact":
|
if CONF.log_packet_format == "compact":
|
||||||
return
|
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:
|
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":
|
if CONF.log_packet_format == "multiline":
|
||||||
log_multiline(packet, tx, header)
|
log_multiline(packet, tx, header)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user