outposts: fix logger again

This commit is contained in:
Jens Langhammer 2020-10-19 18:52:17 +02:00
parent f8ad604e85
commit 169f3ebe5b
2 changed files with 4 additions and 8 deletions

View File

@ -1,7 +1,7 @@
"""Base Controller""" """Base Controller"""
from typing import Dict, List from typing import Dict, List
from structlog import get_logger, wrap_logger from structlog import get_logger
from structlog.testing import capture_logs from structlog.testing import capture_logs
from passbook.lib.sentry import SentryIgnoredException from passbook.lib.sentry import SentryIgnoredException
@ -21,9 +21,7 @@ class BaseController:
def __init__(self, outpost: Outpost): def __init__(self, outpost: Outpost):
self.outpost = outpost self.outpost = outpost
self.logger = wrap_logger( self.logger = get_logger()
get_logger(), controller=self.__class__.__name__, outpost=self.outpost
)
self.deployment_ports = {} self.deployment_ports = {}
# pylint: disable=invalid-name # pylint: disable=invalid-name

View File

@ -3,7 +3,7 @@ from typing import TYPE_CHECKING, Generic, TypeVar
from kubernetes.client import V1ObjectMeta from kubernetes.client import V1ObjectMeta
from kubernetes.client.rest import ApiException from kubernetes.client.rest import ApiException
from structlog import get_logger, wrap_logger from structlog import get_logger
from passbook import __version__ from passbook import __version__
from passbook.lib.sentry import SentryIgnoredException from passbook.lib.sentry import SentryIgnoredException
@ -35,9 +35,7 @@ class KubernetesObjectReconciler(Generic[T]):
def __init__(self, controller: "KubernetesController"): def __init__(self, controller: "KubernetesController"):
self.controller = controller self.controller = controller
self.namespace = controller.outpost.config.kubernetes_namespace self.namespace = controller.outpost.config.kubernetes_namespace
self.logger = wrap_logger( self.logger = get_logger()
get_logger(), controller=self.__class__.__name__, outpost=controller.outpost
)
@property @property
def name(self) -> str: def name(self) -> str: