From a2780471694a527803e4fab9a39ef34c66b376ec Mon Sep 17 00:00:00 2001 From: Reid 'arrdem' McKenzie Date: Sat, 3 Jun 2023 15:14:02 -0600 Subject: [PATCH] Create a trace mode for SQL inspection --- projects/tentacles/src/python/tentacles/__main__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/projects/tentacles/src/python/tentacles/__main__.py b/projects/tentacles/src/python/tentacles/__main__.py index 0e95cea..091b3fc 100644 --- a/projects/tentacles/src/python/tentacles/__main__.py +++ b/projects/tentacles/src/python/tentacles/__main__.py @@ -103,15 +103,17 @@ def make_app(): @cli.command() @click.option("--hostname", "hostname", type=str, default="0.0.0.0") @click.option("--port", "port", type=int, default=8080) +@click.option("--trace/--no-trace", "trace", default=False) @click.option("--config", type=Path) -def serve(hostname: str, port: int, config: Path): +def serve(hostname: str, port: int, config: Path, trace: bool): logging.basicConfig( format="%(asctime)s %(threadName)s - %(name)s - %(levelname)s - %(message)s", level=logging.INFO, ) logging.getLogger("tentacles").setLevel(logging.DEBUG) - logging.getLogger("tentacles.db").setLevel(logging.DEBUG - 1) + if trace: + logging.getLogger("tentacles.db").setLevel(logging.DEBUG - 1) app = make_app()