logWrite replaced with logging module
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
from datetime import datetime, timedelta
|
||||
from uuid import uuid1
|
||||
|
||||
@@ -21,7 +22,9 @@ from modules.security import (
|
||||
get_user,
|
||||
verify_password,
|
||||
)
|
||||
from modules.utils import configGet, logWrite
|
||||
from modules.utils import configGet
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
async def send_confirmation(user: str, email: str):
|
||||
@@ -41,9 +44,11 @@ async def send_confirmation(user: str, email: str):
|
||||
col_emails.insert_one(
|
||||
{"user": user, "email": email, "used": False, "code": confirmation_code}
|
||||
)
|
||||
logWrite(f"Sent confirmation email to '{email}' with code {confirmation_code}")
|
||||
logger.info(
|
||||
"Sent confirmation email to '%s' with code %s", email, confirmation_code
|
||||
)
|
||||
except Exception as exp:
|
||||
logWrite(f"Could not send confirmation email to '{email}' due to: {exp}")
|
||||
logger.error("Could not send confirmation email to '%s' due to: %s", email, exp)
|
||||
|
||||
|
||||
@app.get("/users/me/", response_model=User)
|
||||
|
Reference in New Issue
Block a user