diff --git a/.gitattributes b/.gitattributes index b3caa273b..48de34a3c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,3 @@ -*.cmd eol=crlf -*.cs eol=crlf -*.sh eol=lf +*.cmd text=auto eol=crlf +*.cs text=auto eol=crlf +*.sh text=auto eol=lf diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 859ecb519..0ef537298 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -526,6 +526,28 @@ "color": "terminal.ansiGreen", }, }, + { + "label": "Run PubSubServer (Debug | Skip Build)", + "type": "process", + "command": "", + "linux": { + "command": "PubSubServer", + }, + "windows": { + "command": "PubSubServer.exe", + }, + "args": [ + "--config", + "${workspaceFolder}/src/DataStreamSuite/PubSubServer/Configurations/${input:pubSubServerConfig}.json", + ], + "options": { + "cwd": "${workspaceFolder}/build/Debug/bin/net7.0" + }, + "icon": { + "id": "run", + "color": "terminal.ansiGreen", + }, + }, { "label": "Run PubSubServer (Release)", "dependsOn": "Build DataStream (Release)", @@ -549,6 +571,28 @@ "color": "terminal.ansiGreen", }, }, + { + "label": "Run PubSubServer (Release | Skip Build)", + "type": "process", + "command": "", + "linux": { + "command": "PubSubServer", + }, + "windows": { + "command": "PubSubServer.exe", + }, + "args": [ + "--config", + "${workspaceFolder}/src/DataStreamSuite/PubSubServer/Configurations/${input:pubSubServerConfig}.json", + ], + "options": { + "cwd": "${workspaceFolder}/build/Release/bin/net7.0" + }, + "icon": { + "id": "run", + "color": "terminal.ansiGreen", + }, + }, { "label": "Run Spark", "dependsOn": "Build Spark", @@ -684,6 +728,36 @@ "id": "wrench" }, }, + { + "label": "View PubSubServer Logs (Last Run)", + "type": "process", + "command": "", + "linux": { + "command": "tools/logging/show_last_run.sh", + "args": [ + "${env:HOME}/.local/share/DataStream/data/logging.PubSubServer", + "Starting PubSubServer" + ] + }, + "windows": { + "command": "tools/logging/show_last_run.cmd", + "args": [ + "DataStream", + "PubSubServer.exe", + "Starting PubSubServer" + ] + }, + "presentation": { + "reveal": "always", + "focus": true, + "panel": "shared", + "showReuseMessage": false, + "close": true, + }, + "icon": { + "id": "wrench" + }, + }, ], "inputs": [ { diff --git a/src/DataStreamSuite/PubSubServer/Program.cs b/src/DataStreamSuite/PubSubServer/Program.cs index 5b1be3303..bbb0b46c7 100644 --- a/src/DataStreamSuite/PubSubServer/Program.cs +++ b/src/DataStreamSuite/PubSubServer/Program.cs @@ -25,11 +25,9 @@ int Run(PubSubServerConfig cfg) { cfg.MergeWith(PubSubServerConfig.Default()); PubSubConfig.SetGlobalConfig(Log.notnull(cfg.PubSub)); Configuration.initialize(cfg.Sparkd); - bool run_echo_server = false; - bool echo_msg_back = false; - cfg.SimpleEchoServer = run_echo_server; + Log.Gen.info("Starting PubSubServer"); return cfg.SimpleEchoServer ?? false ? - RunEchoServer(cfg.PubSub.ServerPort.assert_value(), echo_msg_back) : + RunEchoServer(cfg.PubSub.ServerPort.assert_value(), false) : RunPubSubServer(); } catch (Exception ex) { // Write the error to console first, in case the logging system is compromised. diff --git a/tools/logging/show_last_run.cmd b/tools/logging/show_last_run.cmd index e7c8ec1e2..7f1a79b0a 100644 --- a/tools/logging/show_last_run.cmd +++ b/tools/logging/show_last_run.cmd @@ -1,6 +1,6 @@ @echo off -set log_dir="%APPDATA%/bts/%1/data/logging.%2" +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 +tac %log_dir%\log | grep "%3" -m 1 -B %num_lines% | tac | less