Merge pull request #168 from OddBloke/log-version
Emit the server software and version to the log on startup
This commit is contained in:
commit
de7acb5abe
7
app.go
7
app.go
|
@ -486,9 +486,14 @@ func ConnectToDatabase(app *App) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FormatVersion constructs the version string for the application
|
||||||
|
func FormatVersion() string {
|
||||||
|
return serverSoftware + " " + softwareVer
|
||||||
|
}
|
||||||
|
|
||||||
// OutputVersion prints out the version of the application.
|
// OutputVersion prints out the version of the application.
|
||||||
func OutputVersion() {
|
func OutputVersion() {
|
||||||
fmt.Println(serverSoftware + " " + softwareVer)
|
fmt.Println(FormatVersion())
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewApp creates a new app instance.
|
// NewApp creates a new app instance.
|
||||||
|
|
|
@ -113,6 +113,7 @@ func main() {
|
||||||
|
|
||||||
// Initialize the application
|
// Initialize the application
|
||||||
var err error
|
var err error
|
||||||
|
log.Info("Starting %s...", writefreely.FormatVersion())
|
||||||
app, err = writefreely.Initialize(app, *debugPtr)
|
app, err = writefreely.Initialize(app, *debugPtr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("%s", err)
|
log.Error("%s", err)
|
||||||
|
|
Loading…
Reference in New Issue