From 8b87e28bef190d5305ada319207f14e9090b3e59 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Mon, 4 Jul 2022 11:07:25 +0800 Subject: [PATCH] =?UTF-8?q?logger=E6=8F=90=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- workflow/__init__.py | 7 +++++++ workflow/video.py | 9 +-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/workflow/__init__.py b/workflow/__init__.py index e69de29..0dc593a 100644 --- a/workflow/__init__.py +++ b/workflow/__init__.py @@ -0,0 +1,7 @@ +import logging + +LOGGER = logging.getLogger("WORKFLOW") +_ch = logging.StreamHandler() +_ch.setLevel(logging.DEBUG) +LOGGER.setLevel(logging.DEBUG) +LOGGER.addHandler(_ch) diff --git a/workflow/video.py b/workflow/video.py index 6946256..45e095e 100644 --- a/workflow/video.py +++ b/workflow/video.py @@ -1,18 +1,11 @@ import os import subprocess -import logging from datetime import datetime, timedelta from typing import IO from config import FFMPEG_EXEC, FFMPEG_USE_HEVC, VIDEO_BITRATE, FFMPEG_USE_NVIDIA_GPU, VIDEO_CLIP_EACH_SEC, VIDEO_CLIP_OVERFLOW_SEC, \ FFMPEG_USE_INTEL_GPU, VIDEO_OUTPUT_DIR, VIDEO_CRF - - -LOGGER = logging.getLogger("VIDEO") -ch = logging.StreamHandler() -ch.setLevel(logging.DEBUG) -LOGGER.setLevel(logging.DEBUG) -LOGGER.addHandler(ch) +from . import LOGGER def base_ts_to_filename(start_ts: float, is_mp4=False) -> str: