added start script

This commit is contained in:
larssand
2026-06-18 22:00:56 +02:00
parent 0e42e42c53
commit 9fbcd5a5c4
5 changed files with 149 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ import socket
from pathlib import Path
def listen_udp_syslog(host: str, port: int, output: str, *, max_bytes: int = 65535) -> None:
def listen_udp_syslog(host: str, port: int, output: str, *, max_bytes: int = 65535, quiet: bool = False) -> None:
output_path = Path(output)
output_path.parent.mkdir(parents=True, exist_ok=True)
@@ -20,4 +20,5 @@ def listen_udp_syslog(host: str, port: int, output: str, *, max_bytes: int = 655
if not message:
continue
handle.write(f"{message}\n")
print(f"{address[0]}:{address[1]} {message}")
if not quiet:
print(f"{address[0]}:{address[1]} {message}")