Skip to content

Commit

Permalink
Emit the server software and version to the log on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
OddBloke committed Aug 11, 2019
1 parent 8557119 commit 7a53af3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app.go
Expand Up @@ -486,9 +486,14 @@ func ConnectToDatabase(app *App) error {
return nil
}

// FormatVersion constructs the version string for the application
func FormatVersion() string {
return serverSoftware + " " + softwareVer
}

// OutputVersion prints out the version of the application.
func OutputVersion() {
fmt.Println(serverSoftware + " " + softwareVer)
fmt.Println(FormatVersion())
}

// NewApp creates a new app instance.
Expand Down
1 change: 1 addition & 0 deletions cmd/writefreely/main.go
Expand Up @@ -113,6 +113,7 @@ func main() {

// Initialize the application
var err error
log.Info("Starting %s...", writefreely.FormatVersion())
app, err = writefreely.Initialize(app, *debugPtr)
if err != nil {
log.Error("%s", err)
Expand Down

0 comments on commit 7a53af3

Please sign in to comment.