Skip to content

Commit

Permalink
add logger functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jhj0517 committed Jul 6, 2024
1 parent 03cc051 commit dd7a9df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import io

from modules.whisper.faster_whisper_inference import FasterWhisperInference
from modules.utils.logger import get_logger
from modules.utils.logger import get_backend_logger
from modules.vad.silero_vad import SileroVAD
from modules.diarize.diarizer import Diarizer
from modules.diarize.audio_loader import SAMPLE_RATE
Expand All @@ -41,7 +41,7 @@
vad_inferencer = None
whisper_inferencer = None
diarization_inferencer = None
logger = get_logger("Whisper-WebUI-Backend")
logger = get_backend_logger()


def format_stream_result(generator: Generator[dict[str, Any], Any, None]):
Expand Down
8 changes: 8 additions & 0 deletions modules/utils/logger.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import logging


def get_gradio_logger():
return get_logger("Whisper-WebUI")


def get_backend_logger():
return get_logger("Whisper-WebUI-Backend")


def get_logger(name: str):
logger = logging.getLogger(name)

Expand Down

0 comments on commit dd7a9df

Please sign in to comment.