Skip to content

Commit

Permalink
feat: ✨ display build versions at start in logs
Browse files Browse the repository at this point in the history
  • Loading branch information
rangzen committed Jul 2, 2024
1 parent 87e61c4 commit 7457c0c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion handlers/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"log/slog"
"net/http"
"os"
"runtime/debug"

"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
Expand All @@ -23,7 +24,19 @@ func NewServer() *Server {
}

func (s *Server) Run() error {
s.log.Info("starting top")
s.log.Info("starting GoTTH top")

info, ok := debug.ReadBuildInfo()
if ok {
s.log.Info("build info",
"go", info.GoVersion,
"version", info.Main.Version,
"path", info.Main.Path,
"sum", info.Main.Sum,
)
} else {
s.log.Warn("build info not available")
}

app := echo.New()
app.HideBanner = true
Expand Down

0 comments on commit 7457c0c

Please sign in to comment.