Skip to content

Commit c597c2b

Browse files
committed
add a hint for log level changed
1 parent 2d9d077 commit c597c2b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

api.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ func (cr *Cluster) initAPIv0() http.Handler {
500500

501501
type logObj struct {
502502
Type string `json:"type"`
503-
Time int64 `json:"time"`
503+
Time int64 `json:"time"` // UnixMilli
504504
Level string `json:"lvl"`
505505
Log string `json:"log"`
506506
}
@@ -553,6 +553,17 @@ func (cr *Cluster) initAPIv0() http.Handler {
553553
level.Store((int32)(LogLevelWarn))
554554
case "ERRO":
555555
level.Store((int32)(LogLevelError))
556+
default:
557+
continue
558+
}
559+
select {
560+
case c <- &logObj{
561+
Type: "log",
562+
Time: time.Now().UnixMilli(),
563+
Level: LogLevelInfo.String(),
564+
Log: "[dashboard]: Set log level of this log.io to " + l,
565+
}:
566+
default:
556567
}
557568
}
558569
}

0 commit comments

Comments
 (0)