From 8ed67e6fadab64561b5c22396281de0d5ea0ee74 Mon Sep 17 00:00:00 2001 From: Marc-Olivier Arsenault Date: Sat, 9 Dec 2023 15:19:51 -0500 Subject: [PATCH] add uuid to logging (#245) --- custom_components/moonraker/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/custom_components/moonraker/__init__.py b/custom_components/moonraker/__init__.py index 01fb577..1acf330 100755 --- a/custom_components/moonraker/__init__.py +++ b/custom_components/moonraker/__init__.py @@ -2,6 +2,7 @@ import asyncio import logging import os.path +import uuid from datetime import timedelta import async_timeout @@ -224,8 +225,9 @@ async def _async_get_gcode_file_detail(self, gcode_filename): async def _async_fetch_data( self, query_path: METHODS, query_object, quiet: bool = False ): - _LOGGER.debug(f"fetching data from: {query_path.value}") - _LOGGER.debug(f"fetching object: {query_object}") + myuuid = str(uuid.uuid4()) + _LOGGER.debug(f"fetching data, uuid: {myuuid}, from: {query_path.value}") + _LOGGER.debug(f"fetching, uuid: {myuuid}, object: {query_object}") if not self.moonraker.client.is_connected: _LOGGER.warning("connection to moonraker down, restarting") await self.moonraker.start() @@ -237,7 +239,7 @@ async def _async_fetch_data( query_path.value, **query_object ) if not quiet: - _LOGGER.debug(f"Query Result: {result}") + _LOGGER.debug(f"Query Result, uuid: {myuuid}: {result}") return result except Exception as exception: raise UpdateFailed() from exception