From f93d28ee7663e64d69b18c704cf4acc2d6570a08 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Fri, 7 Jun 2024 10:41:27 -0500 Subject: [PATCH] vscode: Add task to view logs for last DSQA run --- .vscode/tasks.json | 25 ++++++++++++++++++++++++- tools/logging/show_last_run.cmd | 6 ++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 tools/logging/show_last_run.cmd diff --git a/.vscode/tasks.json b/.vscode/tasks.json index a5f15b221..859ecb519 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -660,7 +660,30 @@ "id": "run", "color": "terminal.ansiGreen", }, - } + }, + { + "label": "View DataStreamQueryAnalyzer Logs (Last Run)", + "type": "process", + "command": "", + "windows": { + "command": "tools/logging/show_last_run.cmd", + "args": [ + "DataStream", + "DataStreamQueryAnalyzer.exe", + "'Starting DataStreamQueryAnalyzer'" + ] + }, + "presentation": { + "reveal": "always", + "focus": true, + "panel": "shared", + "showReuseMessage": false, + "close": true, + }, + "icon": { + "id": "wrench" + }, + }, ], "inputs": [ { diff --git a/tools/logging/show_last_run.cmd b/tools/logging/show_last_run.cmd new file mode 100644 index 000000000..e7c8ec1e2 --- /dev/null +++ b/tools/logging/show_last_run.cmd @@ -0,0 +1,6 @@ +@echo off + +set log_dir="%APPDATA%/bts/%1/data/logging.%2" +set num_lines=9999 + +tac "%log_dir%/log" | grep "%3" -m 1 -B %num_lines% | tac | less