refactor: Refactor storage and new serve template (#947)

This commit is contained in:
Fangyin Cheng
2023-12-18 19:30:40 +08:00
committed by GitHub
parent 22d95b444b
commit 511a43b849
63 changed files with 1891 additions and 229 deletions

View File

@@ -6,7 +6,6 @@ import logging.handlers
from typing import Any, List
import os
import sys
import asyncio
from dbgpt.configs.model_config import LOGDIR
@@ -81,17 +80,6 @@ def _build_logger(logger_name, logging_level=None, logger_filename: str = None):
setup_logging_level(logging_level=logging_level)
logging.getLogger().handlers[0].setFormatter(formatter)
# Redirect stdout and stderr to loggers
# stdout_logger = logging.getLogger("stdout")
# stdout_logger.setLevel(logging.INFO)
# sl_1 = StreamToLogger(stdout_logger, logging.INFO)
# sys.stdout = sl_1
#
# stderr_logger = logging.getLogger("stderr")
# stderr_logger.setLevel(logging.ERROR)
# sl = StreamToLogger(stderr_logger, logging.ERROR)
# sys.stderr = sl
# Add a file handler for all loggers
if handler is None and logger_filename:
os.makedirs(LOGDIR, exist_ok=True)