Skip to content

Commit

Permalink
STAR-1200: Better logging for dtests (#55)
Browse files Browse the repository at this point in the history
(cherry picked from commit d97c829)
(cherry picked from commit fa2cd87)
(cherry picked from commit f202687)
  • Loading branch information
jacek-lewandowski authored and djatnieks committed Aug 21, 2023
1 parent 90dd2d6 commit 648a02e
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ lib/
pyvenv.cfg
src/
.vscode/

pytest.ini
7 changes: 7 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,13 @@ class level seems to work, and I guess it's not that much extra overhead to setu
if request.config.inicfg.get("log_format") is not None:
logging_format = request.config.inicfg.get("log_format")

# ccm logger is configured to spit everything to console
# we want it to use logging setup configured for tests
# unless we do that, we get duplicated log records from ccm module
ccmLogger = logging.getLogger("ccm")
for handler in ccmLogger.handlers:
logging.getLogger("ccm").removeHandler(handler)

logging.basicConfig(level=log_level,
format=logging_format)

Expand Down
10 changes: 8 additions & 2 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
addopts = --show-capture=stdout
python_files = test_*.py *_test.py *_tests.py
junit_suite_name = Cassandra dtests
log_level = INFO
log_format = %(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s
log_print = True
log_cli = True
log_cli_level = DEBUG
log_cli_format = %(asctime)s,%(msecs)03d %(name)s %(levelname)s %(message)s
log_cli_date_format = %Y-%m-%d %H:%M:%S
log_file_level = DEBUG
log_file_format = %(asctime)s,%(msecs)03d %(name)s %(levelname)s %(message)s
log_file_date_format = %Y-%m-%d %H:%M:%S
timeout = 900
markers =
since
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--- a/pytest.ini
+++ b/pytest.ini
@@ -2,10 +2,6 @@
addopts = --show-capture=stdout
python_files = test_*.py *_test.py *_tests.py
junit_suite_name = Cassandra dtests
-<<<<<<<
-log_level = INFO
-log_format = %(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s
-=======
log_print = True
log_cli = True
log_cli_level = DEBUG
@@ -14,7 +10,6 @@
log_file_level = DEBUG
log_file_format = %(asctime)s,%(msecs)03d %(name)s %(levelname)s %(message)s
log_file_date_format = %Y-%m-%d %H:%M:%S
->>>>>>>
timeout = 900
markers =
since

0 comments on commit 648a02e

Please sign in to comment.