Skip to content

Commit

Permalink
add info log print run version
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxinwang committed Jun 2, 2024
1 parent 1a058ff commit 2dc81da
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

version="v0.0.1"
version="v0.0.2"
currentDir=$(cd $(dirname "$0") || exit; pwd)

path="github.com/go-demo/version"
Expand Down
2 changes: 2 additions & 0 deletions utils/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package utils
import (
"flag"
"github.com/go-demo/version"
"github.com/siddontang/go-log/log"
"os"
)

Expand All @@ -28,5 +29,6 @@ func InitHelp() (help *Help) {
version.PrintVersion()
os.Exit(0)
}
log.Infof("starting version: %s", version.Version)
return help
}
2 changes: 1 addition & 1 deletion utils/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func StartHttp(inputParam *Help) {
// Start prometheus http monitor
go func() {
metrics.OpsStartTime.Set(float64(time.Now().Unix()))
log.Infof("starting http on port %d", *inputParam.HttpPort)
log.Infof("starting http on port: %d", *inputParam.HttpPort)
http.Handle("/metrics", promhttp.Handler())
httpPortAddr := fmt.Sprintf(":%d", *inputParam.HttpPort)
err := http.ListenAndServe(httpPortAddr, nil)
Expand Down

0 comments on commit 2dc81da

Please sign in to comment.