Skip to content

Commit

Permalink
Fix too verbose HTTP logging for Azure Data Explorer (home-assistant#…
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelvriend authored and adriencog committed Jul 13, 2024
1 parent b4705fe commit 7e590a8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions homeassistant/components/azure_data_explorer/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,18 @@ def __init__(self, data: Mapping[str, Any]) -> None:
)

if data[CONF_USE_QUEUED_CLIENT] is True:
# Queded is the only option supported on free tear of ADX
# Queued is the only option supported on free tier of ADX
self.write_client = QueuedIngestClient(kcsb_ingest)
else:
self.write_client = ManagedStreamingIngestClient.from_dm_kcsb(kcsb_ingest)

self.query_client = KustoClient(kcsb_query)

# Reduce the HTTP logging, the default INFO logging is too verbose.
logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(
logging.WARNING
)

def test_connection(self) -> None:
"""Test connection, will throw Exception if it cannot connect."""

Expand All @@ -80,7 +85,7 @@ def test_connection(self) -> None:
self.query_client.execute_query(self._database, query)

def ingest_data(self, adx_events: str) -> None:
"""Send data to Axure Data Explorer."""
"""Send data to Azure Data Explorer."""

bytes_stream = io.StringIO(adx_events)
stream_descriptor = StreamDescriptor(bytes_stream)
Expand Down

0 comments on commit 7e590a8

Please sign in to comment.