Emit the server software and version to the log on startup

This commit is contained in:
Daniel Watkins 2019-08-10 12:02:38 -04:00
parent 8557119451
commit 7a53af355e
No known key found for this signature in database
GPG Key ID: EEE68776EDB13EA0
2 changed files with 7 additions and 1 deletions

7
app.go
View File

@ -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.

View File

@ -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)