summaryrefslogtreecommitdiff
path: root/cmd/util/debug.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/util/debug.go')
-rw-r--r--cmd/util/debug.go24
1 files changed, 23 insertions, 1 deletions
diff --git a/cmd/util/debug.go b/cmd/util/debug.go
index f64b9bc4..54ef104f 100644
--- a/cmd/util/debug.go
+++ b/cmd/util/debug.go
@@ -3,6 +3,7 @@ package util
import (
"github.com/sirupsen/logrus"
"github.com/spiral/roadrunner"
+ "github.com/spiral/roadrunner/service/watcher"
"strings"
)
@@ -12,7 +13,7 @@ func LogEvent(logger *logrus.Logger, event int, ctx interface{}) bool {
case roadrunner.EventWorkerKill:
w := ctx.(*roadrunner.Worker)
logger.Warning(Sprintf(
- "<white+hb>worker.%v</reset> <yellow>killed</red>",
+ "<white+hb>worker.%v</reset> <yellow>killed</reset>",
*w.Pid,
))
return true
@@ -57,5 +58,26 @@ func LogEvent(logger *logrus.Logger, event int, ctx interface{}) bool {
return true
}
+ // watchers
+ switch event {
+ case watcher.EventMaxTTL:
+ w := ctx.(roadrunner.WorkerError)
+ logger.Debug(Sprintf(
+ "<white+hb>worker.%v</reset> <yellow>%s</reset>",
+ *w.Worker.Pid,
+ w.Caused,
+ ))
+ return true
+
+ case watcher.EventMaxMemory:
+ w := ctx.(roadrunner.WorkerError)
+ logger.Warning(Sprintf(
+ "<white+hb>worker.%v</reset> <red>%s</reset>",
+ *w.Worker.Pid,
+ w.Caused,
+ ))
+ return true
+ }
+
return false
}