log management update 02

This commit is contained in:
13339479676 2022-01-14 19:49:23 +08:00
parent c6a2b89b29
commit 9730f143fc
2 changed files with 13 additions and 7 deletions

View File

@ -12,6 +12,7 @@ import sys
from utils.ows_path import increment_path
from utils.hotkeyjudge import hotkey_judge
from utils.frame_opt import frame_opt
from utils.log import log_management
def parse_args(known=False):
@ -54,13 +55,6 @@ def parse_args(known=False):
return args
# 日志管理
def log_management(logContent, logName="test.log", logSaveMode="a"):
ROOT_PATH = sys.path[0]
logFile = open(f'{ROOT_PATH}/{logName}', logSaveMode)
logFile.write(logContent)
# Webcam OpenCV
def webcam_opencv(device_index=0, quit_key="q", pause_key="p", is_autoSaveFrame=False, frame_saveDir="./WebcamFrame",
frame_dirName="frames", frame_nSave=1, auto_frameNum=0, is_handSaveFrame=False, frame_capKey="a",

12
utils/log.py Normal file
View File

@ -0,0 +1,12 @@
# OpenCV Webcam Script v0.3
# 创建人:曾逸夫
# 创建时间2022-01-14
import sys
# 日志管理
def log_management(logContent, logName="test.log", logSaveMode="a"):
ROOT_PATH = sys.path[0]
logFile = open(f'{ROOT_PATH}/{logName}', logSaveMode)
logFile.write(logContent)