From fceb3b61c7579b0cf8518600dbc7f1ae5626a487 Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 30 Jan 2024 14:00:53 +0300 Subject: [PATCH] logs-fix --- schemas/core.graphql | 2 +- services/auth.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/schemas/core.graphql b/schemas/core.graphql index 135b2cd2..c2d1514b 100644 --- a/schemas/core.graphql +++ b/schemas/core.graphql @@ -349,7 +349,7 @@ type Query { get_authors_all: [Author] get_author_followers(slug: String, user: String, author_id: Int): [Author] get_author_followed(slug: String, user: String, author_id: Int): [Author] - load_authors_by(by: AuthorsBy, limit: Int, offset: Int): [Author] + load_authors_by(by: AuthorsBy!, limit: Int, offset: Int): [Author] # community get_community: Community diff --git a/services/auth.py b/services/auth.py index 947e65b9..8783c08d 100644 --- a/services/auth.py +++ b/services/auth.py @@ -7,7 +7,6 @@ from starlette.exceptions import HTTPException from settings import AUTH_SECRET, AUTH_URL -logging.basicConfig() logger = logging.getLogger('\t[services.auth]\t') logger.setLevel(logging.DEBUG) @@ -23,7 +22,7 @@ async def request_data(gql, headers=None): data = await response.json() errors = data.get('errors') if errors: - logger.error(f'[services.auth] errors: {errors}') + logger.error(f'HTTP Errors: {errors}') else: return data except Exception as e: @@ -37,7 +36,7 @@ async def check_auth(req) -> str | None: user_id = '' if token: # Logging the authentication token - logger.error(f'[services.auth] checking auth token: {token}') + logger.debug(f'{token}') query_name = 'validate_jwt_token' operation = 'ValidateToken' variables = {