cmd/syncthing: Improve logged device information on startup (#5321)

This commit is contained in:
Simon Frei 2018-11-22 11:39:01 +01:00 committed by GitHub
parent 2f9840ddae
commit 0391c57a37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -828,9 +828,11 @@ func syncthingMain(runtimeOptions RuntimeOptions) {
pprof.StartCPUProfile(f)
}
myDev, _ := cfg.Device(myID)
l.Infof(`My name is "%v"`, myDev.Name)
for _, device := range cfg.Devices() {
if len(device.Name) > 0 {
l.Infof("Device %s is %q at %v", device.DeviceID, device.Name, device.Addresses)
if device.DeviceID != myID {
l.Infof(`Device %s is "%v" at %v`, device.DeviceID, device.Name, device.Addresses)
}
}