Configure logging format flexibly
Now we can get tempest log file with options in run_tests.sh.
This adds log.py and enables to configure log format more flexibly
using configuration file.
This adds a LoggerAdaptor and a Formatter to output each test name
to log lines.
Implements: blueprint add-logging-configuration
Change-Id: I88cf18bb8bbc152e62ac83a9c7dc26067b7a11bd
diff --git a/run_tests.sh b/run_tests.sh
index 56a6e6e..d5b2494 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -75,6 +75,16 @@
export TEMPEST_CONFIG=`basename "$config_file"`
fi
+if [ $logging -eq 1 ]; then
+ if [ ! -f "$logging_config" ]; then
+ echo "No such logging config file: $logging_config"
+ exit 1
+ fi
+ logging_config=`readlink -f "$logging_config"`
+ export TEMPEST_LOG_CONFIG_DIR=`dirname "$logging_config"`
+ export TEMPEST_LOG_CONFIG=`basename "$logging_config"`
+fi
+
cd `dirname "$0"`
export NOSE_WITH_OPENSTACK=1
@@ -84,14 +94,6 @@
export NOSE_OPENSTACK_SHOW_ELAPSED=1
export NOSE_OPENSTACK_STDOUT=1
-if [ $logging -eq 1 ]; then
- if [ ! -f "$logging_config" ]; then
- echo "No such logging config file: $logging_config"
- exit
- fi
- noseargs="$noseargs --logging-config=$logging_config"
-fi
-
if [ $no_site_packages -eq 1 ]; then
installvenvopts="--no-site-packages"
fi