From 629aeadf081407b6dbd4f10d15a2c3a8c92b23f4 Mon Sep 17 00:00:00 2001 From: Relm-Arrowny Date: Fri, 4 Oct 2024 10:04:22 +0000 Subject: [PATCH] remove code from an old fork branch --- src/blueapi/cli/cli.py | 4 +--- src/blueapi/service/interface.py | 2 +- src/blueapi/service/main.py | 8 -------- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/blueapi/cli/cli.py b/src/blueapi/cli/cli.py index e898c5b81..c0069214d 100644 --- a/src/blueapi/cli/cli.py +++ b/src/blueapi/cli/cli.py @@ -54,9 +54,7 @@ def main(ctx: click.Context, config: Path | None | tuple[Path, ...]) -> None: loaded_config: ApplicationConfig = config_loader.load() ctx.obj["config"] = loaded_config - logging.basicConfig( - format="%(asctime)s - %(message)s", level=loaded_config.logging.level - ) + logging.basicConfig(level=loaded_config.logging.level) if ctx.invoked_subcommand is None: print("Please invoke subcommand!") diff --git a/src/blueapi/service/interface.py b/src/blueapi/service/interface.py index 6af6a2395..914639c62 100644 --- a/src/blueapi/service/interface.py +++ b/src/blueapi/service/interface.py @@ -81,7 +81,7 @@ def setup(config: ApplicationConfig) -> None: # Eagerly initialize worker and messaging connection - logging.basicConfig(format="%(asctime)s - %(message)s", level=config.logging.level) + logging.basicConfig(level=config.logging.level) worker() messaging_template() diff --git a/src/blueapi/service/main.py b/src/blueapi/service/main.py index 2f4651f6a..0a5c25070 100644 --- a/src/blueapi/service/main.py +++ b/src/blueapi/service/main.py @@ -332,15 +332,7 @@ def set_state( def start(config: ApplicationConfig): import uvicorn - from uvicorn.config import LOGGING_CONFIG - LOGGING_CONFIG["formatters"]["default"]["fmt"] = ( - "%(asctime)s %(levelprefix)s %(message)s" - ) - LOGGING_CONFIG["formatters"]["access"]["fmt"] = ( - "%(asctime)s %(levelprefix)s %(client_addr)s" - + " - '%(request_line)s' %(status_code)s" - ) app.state.config = config uvicorn.run(app, host=config.api.host, port=config.api.port)