mirror of
https://github.com/rqlite/rqlite.git
synced 2022-10-30 02:37:32 +03:00
Log, and add to version output, SQLite release
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user