*(minor): stdlib logging to structlog

This commit is contained in:
Langhammer, Jens
2019-10-01 10:24:10 +02:00
parent b3aede5bba
commit f4499a5459
56 changed files with 111 additions and 259 deletions

View File

@ -1,9 +1,9 @@
"""passbook multi-factor authentication engine"""
from logging import getLogger
from structlog import get_logger
from passbook.core.auth.factor import AuthenticationFactor
LOGGER = getLogger(__name__)
LOGGER = get_logger(__name__)
class DummyFactor(AuthenticationFactor):

View File

@ -1,6 +1,5 @@
"""passbook multi-factor authentication engine"""
from inspect import Signature
from logging import getLogger
from django.contrib import messages
from django.contrib.auth import _clean_credentials
@ -10,6 +9,7 @@ from django.forms.utils import ErrorList
from django.shortcuts import redirect, reverse
from django.utils.translation import gettext as _
from django.views.generic import FormView
from structlog import get_logger
from passbook.core.auth.factor import AuthenticationFactor
from passbook.core.auth.view import AuthenticationView
@ -19,7 +19,7 @@ from passbook.core.tasks import send_email
from passbook.lib.config import CONFIG
from passbook.lib.utils.reflection import path_to_class
LOGGER = getLogger(__name__)
LOGGER = get_logger(__name__)
def authenticate(request, backends, **credentials):

View File

@ -1,5 +1,4 @@
"""passbook multi-factor authentication engine"""
from logging import getLogger
from typing import List, Tuple
from django.contrib.auth import login
@ -7,6 +6,7 @@ from django.contrib.auth.mixins import UserPassesTestMixin
from django.shortcuts import get_object_or_404, redirect, reverse
from django.utils.http import urlencode
from django.views.generic import View
from structlog import get_logger
from passbook.core.models import Factor, User
from passbook.core.views.utils import PermissionDeniedView
@ -14,7 +14,7 @@ from passbook.lib.utils.reflection import class_to_path, path_to_class
from passbook.lib.utils.urls import is_url_absolute
from passbook.policy.engine import PolicyEngine
LOGGER = getLogger(__name__)
LOGGER = get_logger(__name__)
def _redirect_with_qs(view, get_query_set=None):
"""Wrapper to redirect whilst keeping GET Parameters"""