summaryrefslogtreecommitdiff
path: root/debug
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-10 20:42:02 +0300
committerWolfy-J <[email protected]>2018-06-10 20:42:02 +0300
commit6831a8865388189f248933e1023fbb4e3b11f67e (patch)
treeb503e15d8450d93dc19f323be2536b016b941ba5 /debug
parented3a0f2bb25077c7a32a54ddb3754f04ffbdccf3 (diff)
debug mode have been added
Diffstat (limited to 'debug')
-rw-r--r--debug/service.go22
1 files changed, 10 insertions, 12 deletions
diff --git a/debug/service.go b/debug/service.go
index 5838b75d..3664e91a 100644
--- a/debug/service.go
+++ b/debug/service.go
@@ -51,14 +51,14 @@ func (s *Service) listener(event int, ctx interface{}) {
switch event {
case http.EventResponse:
log := ctx.(*http.Log)
- s.Logger.Print(utils.Sprintf("%s <white+hb>%s</reset> %s", statusColor(log.Status), log.Method, log.Uri))
+ s.Logger.Info(utils.Sprintf("%s <white+hb>%s</reset> %s", statusColor(log.Status), log.Method, log.Uri))
case http.EventError:
log := ctx.(*http.Log)
if _, ok := log.Error.(roadrunner.JobError); ok {
- s.Logger.Print(utils.Sprintf("%s <white+hb>%s</reset> %s", statusColor(log.Status), log.Method, log.Uri))
+ s.Logger.Info(utils.Sprintf("%s <white+hb>%s</reset> %s", statusColor(log.Status), log.Method, log.Uri))
} else {
- s.Logger.Print(utils.Sprintf(
+ s.Logger.Info(utils.Sprintf(
"%s <white+hb>%s</reset> %s <red>%s</reset>",
statusColor(log.Status),
log.Method,
@@ -71,15 +71,15 @@ func (s *Service) listener(event int, ctx interface{}) {
switch event {
case roadrunner.EventWorkerKill:
w := ctx.(*roadrunner.Worker)
- s.Logger.Print(utils.Sprintf(
- "<white+hb>worker.%v</reset> <red>killed</red>",
+ s.Logger.Warning(utils.Sprintf(
+ "<white+hb>worker.%v</reset> <yellow>killed</red>",
*w.Pid,
))
case roadrunner.EventWorkerError:
err := ctx.(roadrunner.WorkerError)
- s.Logger.Print(utils.Sprintf(
- "<white+hb>worker.%v</reset> <red></reset>",
+ s.Logger.Error(utils.Sprintf(
+ "<white+hb>worker.%v</reset> <red>%s</reset>",
*err.Worker.Pid,
err.Caused,
))
@@ -88,17 +88,15 @@ func (s *Service) listener(event int, ctx interface{}) {
// rr server events
switch event {
case roadrunner.EventServerFailure:
- s.Logger.Print(utils.Sprintf("<red+hb>http.rr</reset>: <red>%s</reset>", ctx))
+ s.Logger.Error(utils.Sprintf("<red+hb>http.rr</reset>: <red+hb>server is dead</reset>"))
}
// pool events
switch event {
case roadrunner.EventPoolConstruct:
- s.Logger.Print(utils.Sprintf("<white+hb>http.rr</reset>: <green>worker pool constructed</reset>"))
- case roadrunner.EventPoolDestruct:
- s.Logger.Print(utils.Sprintf("<white+hb>http.rr</reset>: <yellow>worker pool destructed</reset>"))
+ s.Logger.Debug(utils.Sprintf("<white+hb>http.rr</reset>: <green>new worker pool</reset>"))
case roadrunner.EventPoolError:
- s.Logger.Print(utils.Sprintf("<red+hb>http.rr</reset>: <red>%s</reset>", ctx))
+ s.Logger.Error(utils.Sprintf("<red+hb>http.rr</reset>: <red>%s</reset>", ctx))
}
}