feat(config): add debug server configuration options
- Add debug server listen address and port configuration in config.json and config.go - Update main.go to use debug config values when in debug mode - Add logging for monitor add/remove commands in commandParse.go
This commit is contained in:
@@ -2,6 +2,7 @@ package command
|
||||
|
||||
import (
|
||||
"Watchdog_Linux-systemd/monitor"
|
||||
"Watchdog_Linux-systemd/postLog"
|
||||
"fmt"
|
||||
"strings"
|
||||
"os"
|
||||
@@ -44,6 +45,7 @@ func ExecuteCommand(input string) error {
|
||||
switch cmdType {
|
||||
case "monitor.add":
|
||||
serviceName := getContent(input, "serviceName")
|
||||
postLog.Info(fmt.Sprintf("Add service monitor: %s", serviceName))
|
||||
if len(serviceName) != 0 {
|
||||
err := monitor.AddServiceMonitor(serviceName)
|
||||
if err != nil {
|
||||
@@ -52,6 +54,7 @@ func ExecuteCommand(input string) error {
|
||||
}
|
||||
case "monitor.remove":
|
||||
serviceName := getContent(input, "serviceName")
|
||||
postLog.Info(fmt.Sprintf("Remove service monitor: %s", serviceName))
|
||||
if len(serviceName) != 0 {
|
||||
err := monitor.RemoveServiceMonitor(serviceName)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user