Skip to content

Commit

Permalink
Add server version and commit value for display
Browse files Browse the repository at this point in the history
  • Loading branch information
alinz committed Apr 22, 2024
1 parent 847c8c7 commit e68922d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"context"
"fmt"
"log/slog"
"net/http"
"os"
Expand All @@ -12,6 +13,9 @@ import (
"ella.to/bus/server"
)

var Version = "master"
var GitCommit = "development"

func getLogLevel() slog.Level {
value := os.Getenv("BUS_LOG_LEVEL")
if value == "" {
Expand Down Expand Up @@ -116,6 +120,11 @@ func main() {
}
defer server.Close()

fmt.Printf(`
Version: %s
GitCommit: %s
`, Version, GitCommit)

slog.Info("starting server", "addr", addr)

err = server.ListenAndServe()
Expand Down

0 comments on commit e68922d

Please sign in to comment.