From 01665600e91ed19ade9d3e76ff4904c4a61b85ef Mon Sep 17 00:00:00 2001 From: Anton Osenenko Date: Sun, 31 Mar 2024 04:30:35 +0200 Subject: [PATCH] fix: disable noisy scapy logger --- saturn_printer.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/saturn_printer.py b/saturn_printer.py index 760c85e..7a509d9 100644 --- a/saturn_printer.py +++ b/saturn_printer.py @@ -14,6 +14,10 @@ import asyncio import logging import random from enum import Enum + +import logging +logging.getLogger("scapy.runtime").setLevel(logging.ERROR) + from scapy.all import IP, UDP, send SATURN_UDP_PORT = 3000 @@ -328,6 +332,7 @@ class SaturnPrinter: It spoofs UDP packet to the printer to make it connect to particular MQTT server """ + logging.getLogger("scapy.runtime").setLevel(logging.WARNING) ip = IP(dst=self.addr[0], src=mqtt_host) any_src_port = random.randint(1024, 65535) udp = UDP(sport=any_src_port, dport=SATURN_UDP_PORT)