Correct type assertion in verbose logger, restart (fixes #2561)
This commit is contained in:
parent
2ab07f3aac
commit
3318651565
@ -32,8 +32,14 @@ func (s *verboseSvc) Serve() {
|
|||||||
sub := events.Default.Subscribe(events.AllEvents)
|
sub := events.Default.Subscribe(events.AllEvents)
|
||||||
defer events.Default.Unsubscribe(sub)
|
defer events.Default.Unsubscribe(sub)
|
||||||
|
|
||||||
// We're ready to start processing events.
|
select {
|
||||||
|
case <-s.started:
|
||||||
|
// The started channel has already been closed; do nothing.
|
||||||
|
default:
|
||||||
|
// This is the first time around. Indicate that we're ready to start
|
||||||
|
// processing events.
|
||||||
close(s.started)
|
close(s.started)
|
||||||
|
}
|
||||||
|
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
@ -96,7 +102,7 @@ func (s *verboseSvc) formatEvent(ev events.Event) string {
|
|||||||
return fmt.Sprintf("Rejected unshared folder %q from device %v", data["folder"], data["device"])
|
return fmt.Sprintf("Rejected unshared folder %q from device %v", data["folder"], data["device"])
|
||||||
|
|
||||||
case events.ItemStarted:
|
case events.ItemStarted:
|
||||||
data := ev.Data.(map[string]interface{})
|
data := ev.Data.(map[string]string)
|
||||||
return fmt.Sprintf("Started syncing %q / %q (%v %v)", data["folder"], data["item"], data["action"], data["type"])
|
return fmt.Sprintf("Started syncing %q / %q (%v %v)", data["folder"], data["item"], data["action"], data["type"])
|
||||||
case events.ItemFinished:
|
case events.ItemFinished:
|
||||||
data := ev.Data.(map[string]interface{})
|
data := ev.Data.(map[string]interface{})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user