cmd/syncthing: Print version information early (fixes #5891) (#5893)

This commit is contained in:
Jakob Borg
2019-07-27 11:58:39 +02:00
parent 35f40e9a58
commit d0c3697152
2 changed files with 9 additions and 6 deletions

View File

@@ -548,6 +548,14 @@ func upgradeViaRest() error {
}
func syncthingMain(runtimeOptions RuntimeOptions) {
// Set a log prefix similar to the ID we will have later on, or early log
// lines look ugly.
l.SetPrefix("[start] ")
// Print our version information up front, so any crash that happens
// early etc. will have it available.
l.Infoln(build.LongVersion)
// Ensure that we have a certificate and key.
cert, err := tls.LoadX509KeyPair(
locations.Get(locations.CertFile),