diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index 00e2eef5d..58eea53b6 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -161,14 +161,14 @@ type serveOptions struct { NoBrowser bool `help:"Do not start browser"` NoRestart bool `env:"STNORESTART" help:"Do not restart Syncthing when exiting due to API/GUI command, upgrade, or crash"` NoDefaultFolder bool `env:"STNODEFAULTFOLDER" help:"Don't create the \"default\" folder on first startup"` - NoUpgrade bool `env:"STNOUPGRADE" help:"Disable automatic upgrades"` + NoUpgrade bool `env:"STNOUPGRADE" help:"Disable automatic upgrades" default:"true"` Paths bool `help:"Show configuration paths"` Paused bool `help:"Start with all devices and folders paused"` Unpaused bool `help:"Start with all devices and folders unpaused"` Upgrade bool `help:"Perform upgrade"` UpgradeCheck bool `help:"Check for available upgrade"` UpgradeTo string `placeholder:"URL" help:"Force upgrade directly from specified URL"` - Verbose bool `help:"Print verbose log output"` + Verbose bool `help:"Print verbose log output" default:"true"` Version bool `help:"Show version"` // Debug options below diff --git a/lib/model/indexhandler.go b/lib/model/indexhandler.go index bfd22c864..2bd46efb6 100644 --- a/lib/model/indexhandler.go +++ b/lib/model/indexhandler.go @@ -336,12 +336,28 @@ func (s *indexHandler) receive(fs []protocol.FileInfo, update bool, op string) e } fset.Update(deviceID, fs) + var minSeq, maxSeq int64 + if len(fs) > 0 { + maxSeq, minSeq = fs[0].SequenceNo(), fs[0].SequenceNo() + for _, f := range fs { + if f.SequenceNo() < minSeq { + minSeq = f.SequenceNo() + } + if f.SequenceNo() > maxSeq { + maxSeq = f.SequenceNo() + } + } + } + seq := fset.Sequence(deviceID) s.evLogger.Log(events.RemoteIndexUpdated, map[string]interface{}{ "device": deviceID.String(), "folder": s.folder, "items": len(fs), "sequence": seq, + "update": update, + "minSeq": minSeq, + "maxSeq": maxSeq, "version": seq, // legacy for sequence }) diff --git a/lib/syncthing/verboseservice.go b/lib/syncthing/verboseservice.go index 7bcb196b7..b5b677a0a 100644 --- a/lib/syncthing/verboseservice.go +++ b/lib/syncthing/verboseservice.go @@ -80,7 +80,7 @@ func (s *verboseService) formatEvent(ev events.Event) string { case events.RemoteIndexUpdated: data := ev.Data.(map[string]interface{}) - return fmt.Sprintf("Device %v sent an index update for %q with %d items", data["device"], data["folder"], data["items"]) + return fmt.Sprintf("Device %v sent an index update for %q with %d items, sequence %d-%d => %d, update %v", data["device"], data["folder"], data["items"], data["minSeq"], data["maxSeq"], data["sequence"], data["update"]) case events.DeviceRejected: data := ev.Data.(map[string]string)