From 80b87574e6b3e58e2736c87558aac8dd1670f8b7 Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Wed, 23 Nov 2022 14:56:09 +0300 Subject: [PATCH 1/2] logs --- auth/jwtcodec.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/auth/jwtcodec.py b/auth/jwtcodec.py index 5a6cfa4d..130007fa 100644 --- a/auth/jwtcodec.py +++ b/auth/jwtcodec.py @@ -9,9 +9,9 @@ class JWTCodec: @staticmethod def encode(user: AuthInput, exp: datetime) -> str: issued = int(datetime.now().timestamp()) - print('[jwtcodec] issued at %r' % issued) + print('[auth.jwtcodec] issued at %r' % issued) expires = int(exp.timestamp()) - print('[jwtcodec] expires at %r' % expires) + print('[auth.jwtcodec] expires at %r' % expires) payload = { "user_id": user.id, "username": user.email or user.phone, @@ -23,7 +23,7 @@ class JWTCodec: try: return jwt.encode(payload, JWT_SECRET_KEY, JWT_ALGORITHM) except Exception as e: - print('[jwtcodec] JWT encode error %r' % e) + print('[auth.jwtcodec] JWT encode error %r' % e) @staticmethod def decode(token: str, verify_exp: bool = True) -> TokenPayload: @@ -39,7 +39,7 @@ class JWTCodec: issuer="discours" ) r = TokenPayload(**payload) - print('[jwtcodec] debug payload %r' % r) + print('[auth.jwtcodec] debug payload %r' % r) return r except jwt.InvalidIssuedAtError: raise ExpiredToken('check token issued time') From cbd34bbe4e59a78fd9c90e8fdd99aca356bd428f Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Wed, 23 Nov 2022 15:29:18 +0300 Subject: [PATCH 2/2] less-log --- services/stat/reacted.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/stat/reacted.py b/services/stat/reacted.py index dfded159..3824ef01 100644 --- a/services/stat/reacted.py +++ b/services/stat/reacted.py @@ -36,7 +36,7 @@ class ReactedStorage: @staticmethod async def get_shout_stat(slug): viewed = int(await ViewedStorage.get_shout(slug)) - print(viewed) + # print(viewed) return { "viewed": viewed, "reacted": len(await ReactedStorage.get_shout(slug)),