update init

This commit is contained in:
谈林海 2023-07-31 14:16:49 +08:00
parent 339c9f1ae2
commit 099f747f1b
2 changed files with 8 additions and 2 deletions

View File

@ -1,18 +1,22 @@
#!/usr/bin/env python #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# @Time : 2023/3/24 13:08
# @Author : 谈林海
import time import time
import loguru import loguru
from pathlib import Path from pathlib import Path
from utils.commons.singleton_control import singleton
from utils.models.models import Config from utils.models.models import Config
from utils.read_file_process.read_yaml_control import HandleYaml from utils.read_file_process.read_yaml_control import HandleYaml
root = Path(__file__).resolve().parents[1] root = Path(__file__).resolve().parents[1]
@singleton
class Loggings: class Loggings:
"""日志操作方法""" """日志操作方法"""
log_path = root / 'logs' log_path = '../logs'
def __new__(cls, *args, **kwargs): def __new__(cls, *args, **kwargs):
loggers = loguru.logger loggers = loguru.logger

View File

@ -6,6 +6,7 @@ import json
from functools import wraps from functools import wraps
import httpx import httpx
from utils import * from utils import *
from utils.commons.allure_control import ReportStyle from utils.commons.allure_control import ReportStyle
from utils.commons.singleton_control import singleton from utils.commons.singleton_control import singleton
@ -48,6 +49,7 @@ class RestClient:
显式关闭会话 显式关闭会话
""" """
self.client.close() self.client.close()
def res_log(func): def res_log(func):
@wraps(func) @wraps(func)
def wrapper(*args, **kwargs): def wrapper(*args, **kwargs):