From c86caa6ce60bb6e601772ae13a1873a26bc44b1c Mon Sep 17 00:00:00 2001 From: Roman Konoval Date: Tue, 8 May 2018 20:52:57 +0200 Subject: [PATCH 1/2] Option to set logging format. Default option is changed to include time and thread name. Thread name is useful as client can set test name in it so that instead of: ``` DEBUG:SST:Writing to textfield u'id_password' with text 'selenium' DEBUG:SST:Check text wrote correctly DEBUG:SST:Clicking element u'login-main-form' DEBUG:SST:Waiting for 'get_element' INFO:SST:Step 5: Tester2 verifies that both tasks appear under his home task tab. ``` Looks like: ``` 2018-05-08 20:49:07,499 test_home_tasks_tab DEBUG:SST:Writing to textfield u'id_password' with text 'selenium' 2018-05-08 20:49:07,602 test_home_tasks_tab DEBUG:SST:Check text wrote correctly 2018-05-08 20:49:07,617 test_home_tasks_tab DEBUG:SST:Clicking element u'login-main-form' 2018-05-08 20:49:08,909 test_home_tasks_tab DEBUG:SST:Waiting for 'get_element' 2018-05-08 20:49:08,957 test_home_tasks_tab INFO:SST:Step 5: Tester2 verifies that both tasks appear under his home task tab. ``` This is especially helpful when multiple tests are run concurrently and log to console. --- src/sst/command.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sst/command.py b/src/sst/command.py index 62fbeb3..0eda40e 100644 --- a/src/sst/command.py +++ b/src/sst/command.py @@ -119,6 +119,9 @@ def get_common_options(): parser.add_option('--log', '--log-level', dest='log_level', default='DEBUG', help=('Set log level for SST logger')) + parser.add_option('--log-format', dest='log_format', + default=' %(asctime)s %(threadName)s %(levelname)s:%(name)s:%(message)s', + help=('Set log format for SST logger')) parser.add_option('-c', '--concurrency', dest='concurrency', default=1, type='int', help='concurrency (number of procs)') @@ -176,7 +179,7 @@ def get_opts(get_options, args=None): cmd_opts.browser_type, browsers.browser_factories.keys()) sys.exit(1) - logging.basicConfig(format=' %(levelname)s:%(name)s:%(message)s') + logging.basicConfig(format=cmd_opts.log_format) logger = logging.getLogger('SST') numeric_level = getattr(logging, cmd_opts.log_level.upper(), logging.DEBUG) From b83125b1eda3845eebd9ba9ac77a580080930f42 Mon Sep 17 00:00:00 2001 From: Roman Konoval Date: Tue, 8 May 2018 20:59:00 +0200 Subject: [PATCH 2/2] bumped version to 0.2.9.3 --- src/sst/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sst/__init__.py b/src/sst/__init__.py index ee926de..086789c 100644 --- a/src/sst/__init__.py +++ b/src/sst/__init__.py @@ -18,7 +18,7 @@ # -__version__ = '0.2.9.2' +__version__ = '0.2.9.3' DEVSERVER_PORT = 8120 # django devserver for internal acceptance tests