debug and vscode debug launch

This commit is contained in:
redanthrax 2022-06-15 14:42:40 -07:00
parent ecddc2fe21
commit d1df98ad3e
5 changed files with 33 additions and 0 deletions

1
.gitignore vendored
View File

@ -10,3 +10,4 @@
*.bmp *.bmp
build/Output build/Output
tacticalagent-v* tacticalagent-v*
tacticalagent

18
.vscode/launch.json vendored Normal file
View File

@ -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}"
}
]
}

View File

@ -49,6 +49,10 @@ var (
) )
func (a *Agent) RunRPC() { func (a *Agent) RunRPC() {
if rmm.DEBUG {
a.Logger.Infoln("DEBUG MODE")
}
a.Logger.Infoln("Agent service started") a.Logger.Infoln("Agent service started")
go a.RunAsService() go a.RunAsService()
var wg sync.WaitGroup var wg sync.WaitGroup

5
shared/debug.go Normal file
View File

@ -0,0 +1,5 @@
//go:build DEBUG
package shared
const DEBUG = true

5
shared/nodebug.go Normal file
View File

@ -0,0 +1,5 @@
//go:build !DEBUG
package shared
const DEBUG = false