Skip to content

Commit

Permalink
add uuid to logging (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcolivierarsenault authored Dec 9, 2023
1 parent 96b07d8 commit 8ed67e6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions custom_components/moonraker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import asyncio
import logging
import os.path
import uuid
from datetime import timedelta

import async_timeout
Expand Down Expand Up @@ -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()
Expand All @@ -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
Expand Down

0 comments on commit 8ed67e6

Please sign in to comment.