faint-arm-51818
09/24/2025, 4:24 PMtall-airline-16756
09/24/2025, 4:24 PMtall-airline-16756
09/24/2025, 4:25 PMfaint-arm-51818
09/24/2025, 4:26 PMtall-airline-16756
09/24/2025, 4:27 PMimport logging
logger = logging.getLogger(__name__)
if not logger.hasHandlers():
handler = logging.StreamHandler()
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.setLevel(<http://logging.INFO|logging.INFO>)
This way, your logger will only have one handler, which should stop those duplicate messages from showing up. If you try this out and still run into any issues, please don’t hesitate to reach out—I’m here to help!