From d8c522233ea7743bc45b609c7e971ac33bb1243c Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 19 Oct 2020 16:44:46 +0200 Subject: [PATCH] outposts: fix outpost mangling log output --- e2e/test_source_oauth.py | 1 + passbook/outposts/controllers/base.py | 6 +++--- passbook/outposts/controllers/k8s/base.py | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/e2e/test_source_oauth.py b/e2e/test_source_oauth.py index abececf88..3684b2219 100644 --- a/e2e/test_source_oauth.py +++ b/e2e/test_source_oauth.py @@ -317,6 +317,7 @@ class TestSourceOAuth1(SeleniumTestCase): self.driver.find_element(By.CSS_SELECTOR, "[name='confirm']").click() # Wait until we've loaded the user info page + sleep(2) self.wait.until(ec.presence_of_element_located((By.ID, "user-settings"))) self.driver.get(self.url("passbook_core:user-settings")) diff --git a/passbook/outposts/controllers/base.py b/passbook/outposts/controllers/base.py index 371ba65e1..21cb952f8 100644 --- a/passbook/outposts/controllers/base.py +++ b/passbook/outposts/controllers/base.py @@ -1,7 +1,7 @@ """Base Controller""" from typing import Dict, List -from structlog import get_logger +from structlog import get_logger, wrap_logger from structlog.testing import capture_logs from passbook.lib.sentry import SentryIgnoredException @@ -21,8 +21,8 @@ class BaseController: def __init__(self, outpost: Outpost): self.outpost = outpost - self.logger = get_logger( - controller=self.__class__.__name__, outpost=self.outpost + self.logger = wrap_logger( + get_logger(), controller=self.__class__.__name__, outpost=self.outpost ) self.deployment_ports = {} diff --git a/passbook/outposts/controllers/k8s/base.py b/passbook/outposts/controllers/k8s/base.py index d0a06e202..bb960800c 100644 --- a/passbook/outposts/controllers/k8s/base.py +++ b/passbook/outposts/controllers/k8s/base.py @@ -3,7 +3,7 @@ from typing import TYPE_CHECKING, Generic, TypeVar from kubernetes.client import V1ObjectMeta from kubernetes.client.rest import ApiException -from structlog import get_logger +from structlog import get_logger, wrap_logger from passbook import __version__ from passbook.lib.sentry import SentryIgnoredException @@ -35,8 +35,8 @@ class KubernetesObjectReconciler(Generic[T]): def __init__(self, controller: "KubernetesController"): self.controller = controller self.namespace = controller.outpost.config.kubernetes_namespace - self.logger = get_logger( - controller=self.__class__.__name__, outpost=controller.outpost + self.logger = wrap_logger( + get_logger(), controller=self.__class__.__name__, outpost=controller.outpost ) @property