From 7dd884d3da900cf8bcc4f0971e4e04e1edf0ef88 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 6 Dec 2021 18:27:36 +0100 Subject: [PATCH] Remove Logger.Print Callers can just use Logger.Printf instead. --- server.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/server.go b/server.go index c786ec0..520723d 100644 --- a/server.go +++ b/server.go @@ -37,7 +37,6 @@ var chatHistoryLimit = 1000 var backlogLimit = 4000 type Logger interface { - Print(v ...interface{}) Printf(format string, v ...interface{}) } @@ -48,11 +47,6 @@ type prefixLogger struct { var _ Logger = (*prefixLogger)(nil) -func (l *prefixLogger) Print(v ...interface{}) { - v = append([]interface{}{l.prefix}, v...) - l.logger.Print(v...) -} - func (l *prefixLogger) Printf(format string, v ...interface{}) { v = append([]interface{}{l.prefix}, v...) l.logger.Printf("%v"+format, v...) @@ -296,12 +290,12 @@ func (s *Server) handle(ic ircConn) { dc := newDownstreamConn(s, ic, id) if err := dc.runUntilRegistered(); err != nil { if !errors.Is(err, io.EOF) { - dc.logger.Print(err) + dc.logger.Printf("%v", err) } } else { dc.user.events <- eventDownstreamConnected{dc} if err := dc.readMessages(dc.user.events); err != nil { - dc.logger.Print(err) + dc.logger.Printf("%v", err) } dc.user.events <- eventDownstreamDisconnected{dc} }