Skip to content

Commit

Permalink
Actually use correct log format for API
Browse files Browse the repository at this point in the history
  • Loading branch information
greenw0lf committed Jan 16, 2025
1 parent 65a5518 commit e59e34b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ def run_api(port: int):
from whisper_api import api
import uvicorn

log_config = uvicorn.config.LOGGING_CONFIG
log_config["formatters"]["default"]["fmt"] = LOG_FORMAT

logger.info("Running Whisper as a service")
uvicorn.run(api, port=port, host="0.0.0.0")
uvicorn.run(api, port=port, host="0.0.0.0", log_config=log_config)


def run_job(input_uri: str, output_uri: str):
Expand Down
5 changes: 1 addition & 4 deletions whisper_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
w_model,
)

LOG_FORMAT = "%(asctime)s|%(levelname)s|%(process)d|%(module)s|%(funcName)s|%(lineno)d|%(message)s"
logging.basicConfig(
format=LOG_FORMAT,
)

logger = logging.getLogger(__name__)
api = FastAPI()

Expand Down

0 comments on commit e59e34b

Please sign in to comment.