From daeb6bf4f0483ff6e6f12473d16fba5a206906a1 Mon Sep 17 00:00:00 2001 From: Toby Padilla Date: Fri, 30 Jul 2021 12:52:57 -0500 Subject: [PATCH] Log server start --- main.go | 7 ++++--- server.go | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 867391175..a632551b0 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,7 @@ package main import ( + "log" "smoothie/tui" tea "github.com/charmbracelet/bubbletea" @@ -16,15 +17,15 @@ func main() { var cfg Config err := babyenv.Parse(&cfg) if err != nil { - panic(err) + log.Fatalln(err) } btm := BubbleTeaMiddleware(tui.SessionHandler, tea.WithAltScreen()) s, err := NewServer(cfg.Port, cfg.KeyPath, LoggingMiddleware(), btm) if err != nil { - panic(err) + log.Fatalln(err) } err = s.Start() if err != nil { - panic(err) + log.Fatalln(err) } } diff --git a/server.go b/server.go index 2f53283c5..857dfa24d 100644 --- a/server.go +++ b/server.go @@ -85,5 +85,6 @@ func (srv *Server) passHandler(ctx ssh.Context, pass string) bool { } func (srv *Server) Start() error { + log.Printf("Starting SSH server on %s\n", srv.server.Addr) return srv.server.ListenAndServe() }