Skip to content

Commit

Permalink
Print useful info on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
mt-inside committed Feb 22, 2024
1 parent 60d104c commit 96218d9
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions pkg/bios/bios_tty.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package bios
import (
"fmt"
"os"
"runtime"

"github.com/mt-inside/http-log/internal/build"
"github.com/mt-inside/http-log/pkg/output"
Expand All @@ -17,10 +18,19 @@ func NewTtyBios(s output.TtyStyler) TtyBios {
}

func (b TtyBios) Version() {
h, err := os.Hostname()
if err != nil {
h = "<unknown hostname>"
}
fmt.Printf(
"%s\n",
"%s %s %s %s %s/%s\n",
// TODO: build time
b.s.Noun(build.NameAndVersion()),
b.s.Noun(build.Name),
b.s.Number(build.Version),
b.s.Number(runtime.Version()),
b.s.Addr(h),
b.s.Noun(runtime.GOOS),
b.s.Noun(runtime.GOARCH),
)
}

Expand Down

0 comments on commit 96218d9

Please sign in to comment.