From c7f2b498b162d3db7ee309a10d5d75c88da5a49a Mon Sep 17 00:00:00 2001 From: Mark Story Date: Fri, 13 Mar 2026 11:46:02 -0400 Subject: [PATCH 1/3] fix(client) Align logger names with package name I missed fixing some logger names when porting code from sentry. Refs getsentry/launchpad#582 --- clients/python/src/taskbroker_client/scheduler/runner.py | 2 +- clients/python/src/taskbroker_client/scheduler/schedules.py | 2 +- clients/python/src/taskbroker_client/worker/client.py | 2 +- clients/python/src/taskbroker_client/worker/worker.py | 2 +- clients/python/src/taskbroker_client/worker/workerchild.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/clients/python/src/taskbroker_client/scheduler/runner.py b/clients/python/src/taskbroker_client/scheduler/runner.py index 707e087e..0af84a4d 100644 --- a/clients/python/src/taskbroker_client/scheduler/runner.py +++ b/clients/python/src/taskbroker_client/scheduler/runner.py @@ -17,7 +17,7 @@ from taskbroker_client.scheduler.schedules import CrontabSchedule, Schedule, TimedeltaSchedule from taskbroker_client.task import Task -logger = logging.getLogger("taskworker.scheduler") +logger = logging.getLogger("taskbrokerclient.scheduler") if TYPE_CHECKING: from sentry_sdk._types import MonitorConfig diff --git a/clients/python/src/taskbroker_client/scheduler/schedules.py b/clients/python/src/taskbroker_client/scheduler/schedules.py index bd29ee73..bbc0d1a0 100644 --- a/clients/python/src/taskbroker_client/scheduler/schedules.py +++ b/clients/python/src/taskbroker_client/scheduler/schedules.py @@ -12,7 +12,7 @@ if TYPE_CHECKING: from sentry_sdk._types import MonitorConfigScheduleUnit -logger = logging.getLogger("taskworker.scheduler") +logger = logging.getLogger("taskbrokerclient.scheduler") class Schedule(metaclass=abc.ABCMeta): diff --git a/clients/python/src/taskbroker_client/worker/client.py b/clients/python/src/taskbroker_client/worker/client.py index 91d8fa58..5239c2e4 100644 --- a/clients/python/src/taskbroker_client/worker/client.py +++ b/clients/python/src/taskbroker_client/worker/client.py @@ -27,7 +27,7 @@ from taskbroker_client.metrics import MetricsBackend from taskbroker_client.types import InflightTaskActivation, ProcessingResult -logger = logging.getLogger("sentry.taskworker.client") +logger = logging.getLogger("taskbrokerclient.worker.client") MAX_ACTIVATION_SIZE = 1024 * 1024 * 10 """Max payload size we will process.""" diff --git a/clients/python/src/taskbroker_client/worker/worker.py b/clients/python/src/taskbroker_client/worker/worker.py index 68474ada..2caa7b02 100644 --- a/clients/python/src/taskbroker_client/worker/worker.py +++ b/clients/python/src/taskbroker_client/worker/worker.py @@ -30,7 +30,7 @@ ) from taskbroker_client.worker.workerchild import child_process -logger = logging.getLogger("sentry.taskworker.worker") +logger = logging.getLogger("taskbrokerclient.worker") class TaskWorker: diff --git a/clients/python/src/taskbroker_client/worker/workerchild.py b/clients/python/src/taskbroker_client/worker/workerchild.py index 8230b088..5d622116 100644 --- a/clients/python/src/taskbroker_client/worker/workerchild.py +++ b/clients/python/src/taskbroker_client/worker/workerchild.py @@ -32,7 +32,7 @@ from taskbroker_client.task import Task from taskbroker_client.types import InflightTaskActivation, ProcessingResult -logger = logging.getLogger("sentry.taskworker.worker") +logger = logging.getLogger("taskbrokerclient.worker") class ProcessingDeadlineExceeded(BaseException): From 7d70f2433ea565b34da5c005cd5b9ae6e4813f27 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Fri, 13 Mar 2026 16:01:38 -0400 Subject: [PATCH 2/3] Align logging scopes more --- clients/python/src/taskbroker_client/registry.py | 2 +- clients/python/src/taskbroker_client/retry.py | 2 +- clients/python/src/taskbroker_client/worker/client.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clients/python/src/taskbroker_client/registry.py b/clients/python/src/taskbroker_client/registry.py index ca67c497..96074499 100644 --- a/clients/python/src/taskbroker_client/registry.py +++ b/clients/python/src/taskbroker_client/registry.py @@ -19,7 +19,7 @@ from taskbroker_client.task import ExternalTask, P, R, Task from taskbroker_client.types import ProducerFactory -logger = logging.getLogger(__name__) +logger = logging.getLogger("taskbrokerclient.registry") ProducerFuture = futures.Future[BrokerValue[KafkaPayload]] diff --git a/clients/python/src/taskbroker_client/retry.py b/clients/python/src/taskbroker_client/retry.py index ca77d3b5..3e5e05f4 100644 --- a/clients/python/src/taskbroker_client/retry.py +++ b/clients/python/src/taskbroker_client/retry.py @@ -13,7 +13,7 @@ from taskbroker_client.state import current_task -logger = logging.getLogger(__name__) +logger = logging.getLogger("taskbrokerclient.retry") class RetryTaskError(Exception): diff --git a/clients/python/src/taskbroker_client/worker/client.py b/clients/python/src/taskbroker_client/worker/client.py index 5239c2e4..44247547 100644 --- a/clients/python/src/taskbroker_client/worker/client.py +++ b/clients/python/src/taskbroker_client/worker/client.py @@ -27,7 +27,7 @@ from taskbroker_client.metrics import MetricsBackend from taskbroker_client.types import InflightTaskActivation, ProcessingResult -logger = logging.getLogger("taskbrokerclient.worker.client") +logger = logging.getLogger("taskbrokerclient.worker") MAX_ACTIVATION_SIZE = 1024 * 1024 * 10 """Max payload size we will process.""" From 1c151832e62947b7b42fcbbd5a4c8fb6aadb68dd Mon Sep 17 00:00:00 2001 From: Mark Story Date: Mon, 16 Mar 2026 10:33:25 -0400 Subject: [PATCH 3/3] Align on __name__ as that is the convention we use most often --- clients/python/src/taskbroker_client/registry.py | 2 +- clients/python/src/taskbroker_client/retry.py | 2 +- clients/python/src/taskbroker_client/scheduler/runner.py | 2 +- clients/python/src/taskbroker_client/scheduler/schedules.py | 2 +- clients/python/src/taskbroker_client/worker/client.py | 2 +- clients/python/src/taskbroker_client/worker/worker.py | 2 +- clients/python/src/taskbroker_client/worker/workerchild.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/clients/python/src/taskbroker_client/registry.py b/clients/python/src/taskbroker_client/registry.py index 96074499..ca67c497 100644 --- a/clients/python/src/taskbroker_client/registry.py +++ b/clients/python/src/taskbroker_client/registry.py @@ -19,7 +19,7 @@ from taskbroker_client.task import ExternalTask, P, R, Task from taskbroker_client.types import ProducerFactory -logger = logging.getLogger("taskbrokerclient.registry") +logger = logging.getLogger(__name__) ProducerFuture = futures.Future[BrokerValue[KafkaPayload]] diff --git a/clients/python/src/taskbroker_client/retry.py b/clients/python/src/taskbroker_client/retry.py index 3e5e05f4..ca77d3b5 100644 --- a/clients/python/src/taskbroker_client/retry.py +++ b/clients/python/src/taskbroker_client/retry.py @@ -13,7 +13,7 @@ from taskbroker_client.state import current_task -logger = logging.getLogger("taskbrokerclient.retry") +logger = logging.getLogger(__name__) class RetryTaskError(Exception): diff --git a/clients/python/src/taskbroker_client/scheduler/runner.py b/clients/python/src/taskbroker_client/scheduler/runner.py index 0af84a4d..eadd9d9b 100644 --- a/clients/python/src/taskbroker_client/scheduler/runner.py +++ b/clients/python/src/taskbroker_client/scheduler/runner.py @@ -17,7 +17,7 @@ from taskbroker_client.scheduler.schedules import CrontabSchedule, Schedule, TimedeltaSchedule from taskbroker_client.task import Task -logger = logging.getLogger("taskbrokerclient.scheduler") +logger = logging.getLogger(__name__) if TYPE_CHECKING: from sentry_sdk._types import MonitorConfig diff --git a/clients/python/src/taskbroker_client/scheduler/schedules.py b/clients/python/src/taskbroker_client/scheduler/schedules.py index bbc0d1a0..ecf6edd1 100644 --- a/clients/python/src/taskbroker_client/scheduler/schedules.py +++ b/clients/python/src/taskbroker_client/scheduler/schedules.py @@ -12,7 +12,7 @@ if TYPE_CHECKING: from sentry_sdk._types import MonitorConfigScheduleUnit -logger = logging.getLogger("taskbrokerclient.scheduler") +logger = logging.getLogger(__name__) class Schedule(metaclass=abc.ABCMeta): diff --git a/clients/python/src/taskbroker_client/worker/client.py b/clients/python/src/taskbroker_client/worker/client.py index 44247547..0670af9c 100644 --- a/clients/python/src/taskbroker_client/worker/client.py +++ b/clients/python/src/taskbroker_client/worker/client.py @@ -27,7 +27,7 @@ from taskbroker_client.metrics import MetricsBackend from taskbroker_client.types import InflightTaskActivation, ProcessingResult -logger = logging.getLogger("taskbrokerclient.worker") +logger = logging.getLogger(__name__) MAX_ACTIVATION_SIZE = 1024 * 1024 * 10 """Max payload size we will process.""" diff --git a/clients/python/src/taskbroker_client/worker/worker.py b/clients/python/src/taskbroker_client/worker/worker.py index 2caa7b02..ca05073f 100644 --- a/clients/python/src/taskbroker_client/worker/worker.py +++ b/clients/python/src/taskbroker_client/worker/worker.py @@ -30,7 +30,7 @@ ) from taskbroker_client.worker.workerchild import child_process -logger = logging.getLogger("taskbrokerclient.worker") +logger = logging.getLogger(__name__) class TaskWorker: diff --git a/clients/python/src/taskbroker_client/worker/workerchild.py b/clients/python/src/taskbroker_client/worker/workerchild.py index 5d622116..b35a346c 100644 --- a/clients/python/src/taskbroker_client/worker/workerchild.py +++ b/clients/python/src/taskbroker_client/worker/workerchild.py @@ -32,7 +32,7 @@ from taskbroker_client.task import Task from taskbroker_client.types import InflightTaskActivation, ProcessingResult -logger = logging.getLogger("taskbrokerclient.worker") +logger = logging.getLogger(__name__) class ProcessingDeadlineExceeded(BaseException):