Skip to content
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

fix log output when running with -u machineui -q #64

Closed
wants to merge 1 commit into from

Conversation

spang
Copy link

@spang spang commented Nov 20, 2013

Looks like no one's run offlineimap with both -u machineui and -q, at least
in a while. This patch fixes the following:

➜ ~ offlineimap -c ~/testofflineimaprc -u machineui -q
OfflineIMAP 6.5.5
Licensed under the GNU GPL v2+ (v2 or any later version)
msg:protocol:MainThread7.0.0
msg:initbanner:MainThreadOfflineIMAP+6.5.5%0A++Licensed+under+the+GNU+GPL+v2%2B+%28v2+or+any+later+version%29
msg:registerthread:Account sync personalpersonal
msg:acct:Account sync personalpersonal
msg:connecting:Account sync personalimap.gmail.com%0A993
msg:syncfolders:Account sync personalIMAP%0AMaildir
msg:registerthread:Folder INBOX [acc: personal]personal
Traceback (most recent call last):
File "/usr/lib/python2.7/logging/init.py", line 851, in emit
msg = self.format(record)
File "/usr/lib/python2.7/logging/init.py", line 724, in format
return fmt.format(record)
File "/home/spang/src/mirrors/offlineimap/offlineimap/ui/Machine.py", line 34, in format
return line + urlencode([('', record.mesg)])[1:]
AttributeError: 'LogRecord' object has no attribute 'mesg'
Logged from file UIBase.py, line 318
msg:threadExited:MainThreadFolder+INBOX+%5Bacc%3A+personal%5D
msg:unregisterthread:MainThreadFolder+INBOX+%5Bacc%3A+personal%5D
msg:acctdone:Account sync personalpersonal
msg:threadExited:MainThreadAccount+sync+personal
msg:unregisterthread:MainThreadAccount+sync+personal
msg:terminate:MainThread0%0A%0A

@konvpalto
Copy link
Member

@jamessan
Copy link

jamessan commented Oct 2, 2014

That patch doesn't change anything for me.

@konvpalto
Copy link
Member

Understood the problem a lot better (hadn't noticed "-q" flag, sorry). Can you retest the patch? URL is the same,
http://codelabs.ru/patches/offlineimap/2014-Fix-warning-processing-for-MachineUI.diff
but contents were significantly changed.

@jamessan
Copy link

jamessan commented Oct 4, 2014

That worked. Thanks!

konvpalto added a commit that referenced this pull request Oct 5, 2014
Old code were trying to pass the message to be output as-is,
but it should really be passed as the 'mesg' key in order to
be properly processed by MAchineLogFormatter.format().

GitHub pull: #64
GitHub pull: #118
Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
@konvpalto
Copy link
Member

Thanks a lot! The fix was pushed as 0aa44c5 to "next" and will be integrated into "master" in a couple of days (if no regressions will be spotted).

@konvpalto konvpalto closed this Oct 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants