Skip to content

Commit

Permalink
kwild: write version to log file too (#1022)
Browse files Browse the repository at this point in the history
* kwild: write version to log file too

* elide trailing "+" if no Build.RevisionShort (from git)
  • Loading branch information
jchappelow authored Sep 25, 2024
1 parent b35de9d commit 4c84ae8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cmd/kwild/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ func New(ctx context.Context, cfg *config.KwildConfig, genesisCfg *chain.Genesis
}
logger = *logger.Named("kwild")

logger.Infof("version %s commit %s", version.KwilVersion, version.Build.RevisionShort)

closers := &closeFuncs{
closers: []func() error{}, // logger.Close is not in here; do it in a defer in Start
logger: logger,
Expand Down
2 changes: 1 addition & 1 deletion internal/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var (
func init() {
if KwilVersion == "" { // not set via ldflags
KwilVersion = kwilVersion
if Build != nil {
if Build != nil && Build.RevisionShort != "" {
// Append VCS revision and workspace dirty flag.
sep := "+" // start build metadata
if strings.Contains(KwilVersion, "+") {
Expand Down

0 comments on commit 4c84ae8

Please sign in to comment.