-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log folder's ID and Label (fixes #3724) #3741
Conversation
So there are two formatting types in use here, inconsistently, since before.
So anyway, long story short, I think we should probably use |
@st-jenkins add to white list |
To be honest, I think we should just print "%s" % cfg and then add a .String() on folder config returning whatever, in case we change something yet again in the future. |
Actually that's a good idea. I was thinking that there were lots of places where the folder label and ID didn't come via a a FolderConfiguration object but that doesn't really seem to be the case, from the diff. So yeah. Although I wouldn't use String() for it, but something else like Description() instead, or printing the actual object for testing and debugging gets annoying. |
OK, now I am using "%q (%s)" format in all log entries. Folder configuration struct has now a method |
Neat! Looks good to me, thanks! There is a merge conflict on the authors change (one of the reasons I prefer doing it), so I'll take care of merging this manually. |
Merged in d3a251e, thanks for the cleanup! |
Thanks for the quick replies! |
startSequence = 0 | ||
continue | ||
} | ||
|
||
l.Debugf("Device %v folder %q is delta index compatible (mlv=%d)", deviceID, folder.ID, dev.MaxSequence) | ||
l.Debugf("Device %v folder %q (%s) is delta index compatible (mlv=%d)", deviceID, folder.Label, folder.ID, dev.MaxSequence) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was saying (over the phone, not sure if it got delivered), that in protocol/bep_extensions.go, we could add:
func (f Folder) Description() string {
return fmt.Sprintf("%q (%s)", f.Label, f.ID)
}
and use folder.Description() in the remaining cases, that cover the protobuf generated messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Purpose
This pull requests fixes issue #3724. Log entries should print folder's ID and Label.
Testing
Testing wasn't necessary for this change.