logging: add a switch to log to syslog
Signed-off-by: Ben Boeckel <mathstuf@gmail.com> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:

committed by
Nicolas Sebrecht

parent
ca1ce256ec
commit
585e5d5e2e
@ -89,6 +89,11 @@ class OfflineImap:
|
||||
parser.add_option("-l", dest="logfile", metavar="FILE",
|
||||
help="log to FILE")
|
||||
|
||||
parser.add_option("-s",
|
||||
action="store_true", dest="syslog",
|
||||
default=False,
|
||||
help="log to syslog")
|
||||
|
||||
parser.add_option("-f", dest="folders",
|
||||
metavar="folder1[,folder2[,...]]",
|
||||
help="only sync the specified folders")
|
||||
@ -196,6 +201,10 @@ class OfflineImap:
|
||||
if options.logfile:
|
||||
self.ui.setlogfile(options.logfile)
|
||||
|
||||
#set up syslog
|
||||
if options.syslog:
|
||||
self.ui.setup_sysloghandler()
|
||||
|
||||
#welcome blurb
|
||||
self.ui.init_banner()
|
||||
|
||||
|
Reference in New Issue
Block a user