Commit 6ab2e594 by ‘chizw’

日志路径优化

1 parent b0f253fe
import logging
import os
import sys
# 获取当前文件所在目录的绝对路径
current_dir = os.path.dirname(os.path.abspath(__file__))
# 将根目录添加到 Python 解释器的搜索路径中
root_dir = os.path.join(current_dir, '..') # 假设根目录是当前目录的父目录
sys.path.append(root_dir)
from logging.handlers import TimedRotatingFileHandler
def setup_logging(log_file):
......@@ -38,4 +32,4 @@ def setup_logging(log_file):
return logger
log=setup_logging('./funasr.log')
\ No newline at end of file
log=setup_logging('%s/funasr.log'% "/app/soft/python_project/audio_dev/logs")
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!