diff --git a/.gitignore b/.gitignore index 363cf4a..db67ee0 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ *.bmp build/Output tacticalagent-v* +tacticalagent \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..da5b13e --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,18 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch file", + "type": "go", + "request": "launch", + "mode": "debug", + "env": {}, + "args": ["-m", "svc", "-logto", "stdout"], + "buildFlags": "-tags=DEBUG", + "program": "${workspaceRoot}" + } + ] +} \ No newline at end of file diff --git a/agent/rpc.go b/agent/rpc.go index 7d24d0b..79f479f 100644 --- a/agent/rpc.go +++ b/agent/rpc.go @@ -49,6 +49,10 @@ var ( ) func (a *Agent) RunRPC() { + if rmm.DEBUG { + a.Logger.Infoln("DEBUG MODE") + } + a.Logger.Infoln("Agent service started") go a.RunAsService() var wg sync.WaitGroup diff --git a/shared/debug.go b/shared/debug.go new file mode 100644 index 0000000..0893720 --- /dev/null +++ b/shared/debug.go @@ -0,0 +1,5 @@ +//go:build DEBUG + +package shared + +const DEBUG = true \ No newline at end of file diff --git a/shared/nodebug.go b/shared/nodebug.go new file mode 100644 index 0000000..e2032ee --- /dev/null +++ b/shared/nodebug.go @@ -0,0 +1,5 @@ +//go:build !DEBUG + +package shared + +const DEBUG = false \ No newline at end of file