added start script
This commit is contained in:
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user