aboutsummaryrefslogtreecommitdiff
path: root/ca/tests/yamltest.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-04-26 20:07:41 +0000
committerRob Austein <sra@hactrn.net>2016-04-26 20:07:41 +0000
commit01697787912f143ab2b9a938e33c73c9a8a9ae0b (patch)
tree8065ac9a88d697678de0ad68c13683c6c2f5dd69 /ca/tests/yamltest.py
parent1447a61b235699163f186ef689ca8eaf898ee478 (diff)
Further consolidation of config file parsing, command line parsing,
and logging setup. Most programs now use the unified mechanism, although there are still a few holdouts: the GUI, which is a special case because it has no command line, and the rpki-rtr program, which, for historical reasons has its own implementation of the logging setup infrastructure. svn path=/branches/tk705/; revision=6390
Diffstat (limited to 'ca/tests/yamltest.py')
-rwxr-xr-xca/tests/yamltest.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/ca/tests/yamltest.py b/ca/tests/yamltest.py
index d467384a..c2959dc9 100755
--- a/ca/tests/yamltest.py
+++ b/ca/tests/yamltest.py
@@ -54,6 +54,7 @@ import rpki.log
import rpki.csv_utils
import rpki.x509
import rpki.relaxng
+import rpki.config
# pylint: disable=W0621
@@ -673,8 +674,10 @@ class allocation(object):
"""
basename = os.path.splitext(os.path.basename(prog))[0]
- cmd = [prog, "--foreground", "--log-level", "debug",
- "--log-file", self.path(basename + ".log")]
+ cmd = [prog, "--foreground",
+ "--log-level", "debug",
+ "--log-destination", "file",
+ "--log-filename", self.path(basename + ".log")]
if args.profile:
cmd.extend((
"--profile", self.path(basename + ".prof")))
@@ -831,8 +834,10 @@ try:
print "Writing pidfile", f.name
f.write("%s\n" % os.getpid())
- rpki.log.init("yamltest", argparse.Namespace(log_level = logging.DEBUG,
- log_handler = lambda: logging.StreamHandler(sys.stdout)))
+ log_handler = logging.StreamHandler(sys.stdout)
+ log_handler.setFormatter(rpki.config.Formatter("yamltest", log_handler, logging.DEBUG))
+ logging.getLogger().addHandler(log_handler)
+ logging.getLogger().setLevel(logging.DEBUG)
allocation.base_port = args.base_port