summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2019-05-03 16:00:14 +0300
committerWolfy-J <[email protected]>2019-05-03 16:00:14 +0300
commit588b53dec2eb27be5ce04616954cfca5b4145817 (patch)
tree45fbdebc58313dfbeeb999ff979fc5373dda51fa /cmd
parent28c787d66c2b74dd2300c792abd1e4f987c3d6c9 (diff)
new watchers functionality
Diffstat (limited to 'cmd')
-rw-r--r--cmd/rr/cmd/root.go12
-rw-r--r--cmd/util/debug.go2
2 files changed, 8 insertions, 6 deletions
diff --git a/cmd/rr/cmd/root.go b/cmd/rr/cmd/root.go
index 2e170307..1222177a 100644
--- a/cmd/rr/cmd/root.go
+++ b/cmd/rr/cmd/root.go
@@ -109,11 +109,13 @@ func init() {
}
// global watcher config
- wcv, _ := Container.Get(watcher.ID)
- if wcv, ok := wcv.(*watcher.Service); ok {
- wcv.AddListener(func(event int, ctx interface{}) {
- util.LogEvent(Logger, event, ctx)
- })
+ if Verbose {
+ wcv, _ := Container.Get(watcher.ID)
+ if wcv, ok := wcv.(*watcher.Service); ok {
+ wcv.AddListener(func(event int, ctx interface{}) {
+ util.LogEvent(Logger, event, ctx)
+ })
+ }
}
})
}
diff --git a/cmd/util/debug.go b/cmd/util/debug.go
index 54ef104f..01082112 100644
--- a/cmd/util/debug.go
+++ b/cmd/util/debug.go
@@ -71,7 +71,7 @@ func LogEvent(logger *logrus.Logger, event int, ctx interface{}) bool {
case watcher.EventMaxMemory:
w := ctx.(roadrunner.WorkerError)
- logger.Warning(Sprintf(
+ logger.Error(Sprintf(
"<white+hb>worker.%v</reset> <red>%s</reset>",
*w.Worker.Pid,
w.Caused,