From a688d8053d2c40fe7d07528dbc841055c6e7b9ae Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Wed, 26 Oct 2022 20:28:12 -0400 Subject: [PATCH] Log, and add to version output, SQLite release --- cmd/rqlited/flags.go | 12 +++++++----- cmd/rqlited/main.go | 14 +++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/cmd/rqlited/flags.go b/cmd/rqlited/flags.go index a40f4c2e..f0267f75 100644 --- a/cmd/rqlited/flags.go +++ b/cmd/rqlited/flags.go @@ -331,9 +331,10 @@ func (c *Config) DiscoConfigReader() io.ReadCloser { // BuildInfo is build information for display at command line. type BuildInfo struct { - Version string - Commit string - Branch string + Version string + Commit string + Branch string + SQLiteVersion string } // ParseFlags parses the command line, and returns the configuration. @@ -404,8 +405,9 @@ func ParseFlags(name, desc string, build *BuildInfo) (*Config, error) { flag.Parse() if showVersion { - msg := fmt.Sprintf("%s %s %s %s %s (commit %s, branch %s, compiler %s)", - name, build.Version, runtime.GOOS, runtime.GOARCH, runtime.Version(), build.Commit, build.Branch, runtime.Compiler) + msg := fmt.Sprintf("%s %s %s %s %s sqlite%s (commit %s, branch %s, compiler %s)", + name, build.Version, runtime.GOOS, runtime.GOARCH, runtime.Version(), build.SQLiteVersion, + build.Commit, build.Branch, runtime.Compiler) errorExit(0, msg) } diff --git a/cmd/rqlited/main.go b/cmd/rqlited/main.go index b2e6ecc0..f2c70c6b 100644 --- a/cmd/rqlited/main.go +++ b/cmd/rqlited/main.go @@ -23,6 +23,7 @@ import ( "github.com/rqlite/rqlite/auth" "github.com/rqlite/rqlite/cluster" "github.com/rqlite/rqlite/cmd" + "github.com/rqlite/rqlite/db" "github.com/rqlite/rqlite/disco" httpd "github.com/rqlite/rqlite/http" "github.com/rqlite/rqlite/store" @@ -53,9 +54,10 @@ func init() { func main() { cfg, err := ParseFlags(name, desc, &BuildInfo{ - Version: cmd.Version, - Commit: cmd.Commit, - Branch: cmd.Branch, + Version: cmd.Version, + Commit: cmd.Commit, + Branch: cmd.Branch, + SQLiteVersion: db.DBVersion, }) if err != nil { log.Fatalf("failed to parse command-line flags: %s", err.Error()) @@ -65,8 +67,10 @@ func main() { fmt.Printf(logo) // Configure logging and pump out initial message. - log.Printf("%s starting, version %s, commit %s, branch %s, compiler %s", name, cmd.Version, cmd.Commit, cmd.Branch, runtime.Compiler) - log.Printf("%s, target architecture is %s, operating system target is %s", runtime.Version(), runtime.GOARCH, runtime.GOOS) + log.Printf("%s starting, version %s, SQLite %s, commit %s, branch %s, compiler %s", name, cmd.Version, + db.DBVersion, cmd.Commit, cmd.Branch, runtime.Compiler) + log.Printf("%s, target architecture is %s, operating system target is %s", runtime.Version(), + runtime.GOARCH, runtime.GOOS) log.Printf("launch command: %s", strings.Join(os.Args, " ")) // Start requested profiling.