设置log日志存储路径。
def set_log_file(log_file: str = '', clean=True)
参数名 |
输入/输出 |
说明 |
---|---|---|
log_file |
输入 |
日志绝对路径文件名,若未设置,默认文件名为当前工作路径下名为debug_op.log。 |
clean |
输入 |
是否清除历史日志。默认为True。 若为True,会清理同名日志文件内容,若为False,会在原有日志续写日志内容。 |
无
import ascendebug # 设置日志文件为'/my_path/api_log.log', 清理历史文件内容 ascendebug.set_log_file('/my_path/api_log.log', clean=True)