diff options
author | Rob Austein <sra@hactrn.net> | 2013-01-25 07:39:13 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2013-01-25 07:39:13 +0000 |
commit | 10b6151727182e7caa7fdfad2d67e406e3afc726 (patch) | |
tree | cb4034b74813bb6374bdd3cb226f022bb45a1440 /rpkid/rpki/pubd.py | |
parent | 95d3eb56c11c96b2a3c0890b1abfb3f9826cdd9f (diff) |
Clean up and extend rpki.log.init() to support things like letting the
GUI provide its own file-like object as a destination for logging.
See #396.
svn path=/trunk/; revision=4979
Diffstat (limited to 'rpkid/rpki/pubd.py')
-rw-r--r-- | rpkid/rpki/pubd.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/rpkid/rpki/pubd.py b/rpkid/rpki/pubd.py index a6d8f83f..b026bfff 100644 --- a/rpkid/rpki/pubd.py +++ b/rpkid/rpki/pubd.py @@ -70,6 +70,8 @@ class main(object): self.foreground = False self.irbe_cms_timestamp = None + use_syslog = True + opts, argv = getopt.getopt(sys.argv[1:], "c:dfhp:?", ["config=", "debug", "foreground", "help", "profile="]) for o, a in opts: @@ -79,7 +81,7 @@ class main(object): elif o in ("-c", "--config"): self.cfg_file = a elif o in ("-d", "--debug"): - rpki.log.use_syslog = False + use_syslog = False self.foreground = True elif o in ("-f", "--foreground"): self.foreground = True @@ -88,7 +90,7 @@ class main(object): if argv: raise rpki.exceptions.CommandParseFailure, "Unexpected arguments %s" % argv - rpki.log.init("pubd") + rpki.log.init("pubd", use_syslog = use_syslog) self.cfg = rpki.config.parser(self.cfg_file, "pubd") self.cfg.set_global_flags() |