From de69d50a7eb4db2e730580efcf18f5c77e489a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= Date: Tue, 18 Jul 2023 18:41:14 -0600 Subject: [PATCH 1/2] feat: Make stream logger a child of the tap logger Closes https://github.com/meltano/sdk/issues/333 --- singer_sdk/streams/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/singer_sdk/streams/core.py b/singer_sdk/streams/core.py index 4c3adb225..9463b2f3f 100644 --- a/singer_sdk/streams/core.py +++ b/singer_sdk/streams/core.py @@ -124,7 +124,7 @@ def __init__( msg = "Missing argument or class variable 'name'." raise ValueError(msg) - self.logger: logging.Logger = tap.logger + self.logger: logging.Logger = tap.logger.getChild(self.name) self.metrics_logger = tap.metrics_logger self.tap_name: str = tap.name self._config: dict = dict(tap.config) From 5632df48e5419ff3866c6609b2c884a3e8b29761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= Date: Thu, 28 Sep 2023 09:16:30 -0600 Subject: [PATCH 2/2] Apply to Sink too --- singer_sdk/sinks/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/singer_sdk/sinks/core.py b/singer_sdk/sinks/core.py index 19dfbc31a..824bde627 100644 --- a/singer_sdk/sinks/core.py +++ b/singer_sdk/sinks/core.py @@ -61,7 +61,7 @@ def __init__( schema: Schema of the stream to sink. key_properties: Primary key of the stream to sink. """ - self.logger = target.logger + self.logger = target.logger.getChild(stream_name) self.sync_started_at = target.initialized_at self._config = dict(target.config) self._pending_batch: dict | None = None