From ea58d5d3c9f0d4534a9ffd028b9461a75922d54f Mon Sep 17 00:00:00 2001 From: Keuin Date: Thu, 8 Sep 2022 11:23:46 +0800 Subject: Remove unnecessary newline in log text. --- recording/watcher.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'recording/watcher.go') diff --git a/recording/watcher.go b/recording/watcher.go index 1c7ef84..afc7ab5 100644 --- a/recording/watcher.go +++ b/recording/watcher.go @@ -128,7 +128,7 @@ func watch( switch msg.Operation { case dmpkg.OpLayer7Data: - //logger.Printf("server message: op %v, body %v\n", msg.Operation, string(msg.Body)) + //logger.Printf("server message: op %v, body %v", msg.Operation, string(msg.Body)) var info liveInfo err := json.Unmarshal(msg.Body, &info) if err != nil { @@ -158,7 +158,7 @@ func watch( fallthrough case "HOT_RANK_CHANGED_V2": // useless message - logger.Printf("Ignore message: %v\n", info.Command) + logger.Printf("Ignore message: %v", info.Command) case "WATCHED_CHANGE": // number of watched people changed obj, exists := info.Data["num"] @@ -167,7 +167,7 @@ func watch( } viewersNum, ok := obj.(float64) if !ok { - logger.Printf("Cannot parse watched people number: %v\n", obj) + logger.Printf("Cannot parse watched people number: %v", obj) continue } logger.Printf("The number of viewers (room: %v): %v", roomId, viewersNum) @@ -175,7 +175,7 @@ func watch( var raw dmmsg.RawInteractWordMessage err = json.Unmarshal(msg.Body, &raw) if err != nil { - logger.Printf("Cannot parse RawInteractWordMessage JSON: %v\n", err) + logger.Printf("Cannot parse RawInteractWordMessage JSON: %v", err) continue } logger.Printf("Interact word message: user: %v medal: %v", @@ -184,22 +184,22 @@ func watch( var raw dmmsg.RawDanMuMessage err = json.Unmarshal(msg.Body, &raw) if err != nil { - logger.Printf("Cannot parse Dan Mu message as JSON: %v\n", err) + logger.Printf("Cannot parse Dan Mu message as JSON: %v", err) continue } dmm, err := dmmsg.ParseDanmakuMessage(raw) if err != nil { - logger.Printf("Cannot parse Dan Mu message JSON: %v\n", err) + logger.Printf("Cannot parse Dan Mu message JSON: %v", err) continue } - logger.Printf("Dan Mu: %v\n", dmm.String()) + logger.Printf("Dan Mu: %v", dmm.String()) default: - logger.Printf("Ignore unhandled server message %v %v %v\n", + logger.Printf("Ignore unhandled server message %v %v %v", info.Command, msg.Operation, string(msg.Body)) } } default: - logger.Printf("Server message: %v\n", msg.String()) + logger.Printf("Server message: %v", msg.String()) } } -- cgit v1.2.3