From 1d0729a9dcfe3f3cebb961114c9bc05136cf8cfb Mon Sep 17 00:00:00 2001 From: Jake Hunsaker Date: Thu, 22 Apr 2021 15:08:07 -0400 Subject: [logging] Fix archive debug logging, adjust verbosity levels Fixes an issue where archive debug logging was controlled by the use of `--debug` rather than `--verbose`. Removes a superfluous log in `FileCacheArchive.add_link()`. Also, adjusts the different verbosity levels to be more meaninful. Now, the use of `-v` will enable debug logging but will not print those messages to console, `-vv` will print debug logging to console, while `-vvv` will enable archive debug logging which is expected to be significant due to most file operations being logging at some point with archive debug logging. Resolves: #2507 Signed-off-by: Jake Hunsaker --- tests/report_tests/basic_report_tests.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'tests/report_tests') diff --git a/tests/report_tests/basic_report_tests.py b/tests/report_tests/basic_report_tests.py index 0cf5bd4e..4a5e0001 100644 --- a/tests/report_tests/basic_report_tests.py +++ b/tests/report_tests/basic_report_tests.py @@ -15,11 +15,15 @@ class NormalSoSReport(StageOneReportTest): :avocado: tags=stageone """ - sos_cmd = '-vvv --label thisismylabel' + sos_cmd = '-v --label thisismylabel' def test_debug_in_logs_verbose(self): self.assertSosLogContains('DEBUG') + def test_debug_not_printed_to_console(self): + self.assertOutputNotContains('added cmd output') + self.assertOutputNotContains('\[archive:.*\]') + def test_postproc_called(self): self.assertSosLogContains('substituting scrpath') @@ -30,6 +34,21 @@ class NormalSoSReport(StageOneReportTest): self.assertFileCollected('free') +class LogLevelTest(StageOneReportTest): + """ + :avocado: tags=stageone + """ + + sos_cmd = '-vvv' + + def test_archive_logging_enabled(self): + self.assertSosLogContains('DEBUG: \[archive:.*\]') + self.assertSosLogContains('Making leading paths for') + + def test_debug_printed_to_console(self): + self.assertOutputContains('\[plugin:.*\]') + + class RestrictedSoSReport(StageOneReportTest): """ :avocado: tags=stageone -- cgit