Include offlineimap and pid in non interactive logs
This patch includes the "offlineimap" string and the proccess id in the output for non interactive logs and syslog logs. Now, the output is something like this (syslog): Oct 11 21:55:10 yangon offlineimap[635798]: Syncing foo: IMAP -> Maildir Oct 11 21:55:10 yangon offlineimap[635798]: Syncing foo bar: IMAP -> Maildir Oct 11 21:55:10 yangon offlineimap[635798]: Syncing INBOX: IMAP -> Maildir Oct 11 21:55:10 yangon offlineimap[635798]: Syncing bar: IMAP -> Maildir Oct 11 21:55:10 yangon offlineimap[635798]: Syncing Trash: IMAP -> Maildir Closes #88
This commit is contained in:
parent
2ce05bc98a
commit
f8cfe98d9c
@ -45,7 +45,7 @@ class Syslog(UIBase):
|
||||
# create syslog handler
|
||||
ch = logging.handlers.SysLogHandler('/dev/log')
|
||||
# create formatter and add it to the handlers
|
||||
self.formatter = logging.Formatter("%(message)s")
|
||||
self.formatter = logging.Formatter("offlineimap[%(process)d]: %(message)s")
|
||||
ch.setFormatter(self.formatter)
|
||||
# add the handlers to the logger
|
||||
self.logger.addHandler(ch)
|
||||
|
@ -99,7 +99,7 @@ class UIBase:
|
||||
# create syslog handler
|
||||
ch = logging.handlers.SysLogHandler('/dev/log')
|
||||
# create formatter and add it to the handlers
|
||||
self.formatter = logging.Formatter("%(message)s")
|
||||
self.formatter = logging.Formatter("offlineimap[%(process)d]: %(message)s")
|
||||
ch.setFormatter(self.formatter)
|
||||
# add the handlers to the logger
|
||||
self.logger.addHandler(ch)
|
||||
|
Loading…
Reference in New Issue
Block a user