fix: hide server rtc_change event log (#14334)

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
Jian Qiu
2022-05-28 09:07:22 +08:00
committed by GitHub
co-authored by Qiu Jian
parent a0f326eb95
commit 94f509a524
+3 -1
View File
@@ -173,11 +173,13 @@ func (m *QmpMonitor) read(r io.Reader) {
for scanner.Scan() {
var objmap map[string]*json.RawMessage
b := scanner.Bytes()
log.Infof("QMP Read %s: %s", m.server, string(b))
if err := json.Unmarshal(b, &objmap); err != nil {
log.Errorf("Unmarshal %s error: %s", m.server, err.Error())
continue
}
if val, ok := objmap["event"]; !ok || !utils.IsInStringArray(string(*val), ignoreEvents) {
log.Infof("QMP Read %s: %s", m.server, string(b))
}
if val, ok := objmap["error"]; ok {
var res = &Response{}
res.ErrorVal = &Error{}