X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/8eb43f95a6f11b6c256ff339399e9479898b4380..a9bdccb79164a787b4f1a2c1579a95cf751aef40:/hotline/server.go?ds=sidebyside diff --git a/hotline/server.go b/hotline/server.go index 392c8f3..ccf992e 100644 --- a/hotline/server.go +++ b/hotline/server.go @@ -18,7 +18,6 @@ import ( "net" "os" "path/filepath" - "runtime/debug" "strings" "sync" "time" @@ -278,7 +277,7 @@ func NewServer(configDir string, netPort int, logger *zap.SugaredLogger, FS File if err := register(t, tr); err != nil { server.Logger.Errorw("unable to register with tracker %v", "error", err) } - server.Logger.Infow("Sent Tracker registration", "data", tr) + server.Logger.Debugw("Sent Tracker registration", "addr", t) } time.Sleep(trackerUpdateFrequency * time.Second) @@ -542,14 +541,6 @@ func (s *Server) loadConfig(path string) error { return nil } -// dontPanic logs panics instead of crashing -func dontPanic(logger *zap.SugaredLogger) { - if r := recover(); r != nil { - fmt.Println("stacktrace from panic: \n" + string(debug.Stack())) - logger.Errorw("PANIC", "err", r, "trace", string(debug.Stack())) - } -} - // handleNewConnection takes a new net.Conn and performs the initial login sequence func (s *Server) handleNewConnection(ctx context.Context, rwc io.ReadWriteCloser, remoteAddr string) error { defer dontPanic(s.Logger)