Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
style(router_class): 使用 f-string 优化日志信息格式
将日志信息中的字符串拼接改为 f-string 格式,以提高代码可读性和性能。
  • Loading branch information
zhangtao
zhangtao committed May 18, 2025
commit 48788f9728bb76a5226d0fec7d91cea38722f47e
4 changes: 2 additions & 2 deletions backend/app/core/router_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ async def custom_route_handler(request: Request) -> Response:
if request.url.path == '/api/v1/system/auth/login':
# 只有登录的才会获取登录地址
if request.client.host == '36.163.173.156':
logger.info(request.client.host, '等于 36.163.173.156')
logger.info(f'{request.client.host} 等于 36.163.173.156')
else:
logger.error(request.client.host, '不等于 36.163.173.156')
logger.error(f'{request.client.host} 不等于 36.163.173.156')
login_location = IpLocalUtil.get_ip_location(request.client.host)

await OperationLogService.create_log_service(data=OperationLogCreateSchema(
Expand Down