This is an automated email from the ASF dual-hosted git repository.

jlewandowski pushed a commit to branch ds-trunk-5.0--2024-07-24
in repository https://gitbox.apache.org/repos/asf/cassandra-dtest.git

commit 1056bd73004b7e7b1370abaac6882b182f9c099e
Author: Jacek Lewandowski <6516951+jacek-lewandow...@users.noreply.github.com>
AuthorDate: Mon Mar 21 14:02:55 2022 +0100

    STAR-1200: Better logging for dtests (#55)
    
    (cherry picked from commit d97c8298395b66e497bb80b344a078666d1a413d)
    (cherry picked from commit fa2cd87d9423b67b728aadfb2455e6ab2a1843ec)
    (cherry picked from commit f202687489a1080368b97d211d72b11e458358b6)
    (cherry picked from commit 648a02e62f4f679fb297ca52ec94ba19cfa89fa5)
---
 .gitignore                                          |  2 ++
 conftest.py                                         |  7 +++++++
 pytest.ini                                          | 10 ++++++++--
 ...26874 STAR-1200: Better logging for dtests (#55) | 21 +++++++++++++++++++++
 4 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index 13045e5b..2f759f0f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,3 +17,5 @@ lib/
 pyvenv.cfg
 src/
 .vscode/
+
+pytest.ini
\ No newline at end of file
diff --git a/conftest.py b/conftest.py
index 1994d656..785eceda 100644
--- a/conftest.py
+++ b/conftest.py
@@ -185,6 +185,13 @@ def fixture_logging_setup(request):
         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)
 
diff --git a/pytest.ini b/pytest.ini
index 79d18eca..138dc62e 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -2,8 +2,14 @@
 addopts = --show-capture=stdout --timeout=900
 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
 markers =
     since
     vnodes
diff --git a/update-history/oss-4.0.11/7-f2026874 STAR-1200: Better logging for 
dtests (#55) b/update-history/oss-4.0.11/7-f2026874 STAR-1200: Better logging 
for dtests (#55)
new file mode 100644
index 00000000..70806cff
--- /dev/null
+++ b/update-history/oss-4.0.11/7-f2026874 STAR-1200: Better logging for dtests 
(#55)   
@@ -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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to