Skip to content

Commit c42a804

Browse files
authored
Merge branch 'master' into enhancement/describe-checks-more-attrs
2 parents 10586c3 + 1ef9b5b commit c42a804

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

reframe/core/logging.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,19 @@ def adjust_verbosity(self, num_steps):
971971

972972
h.setLevel(new_level)
973973

974+
def set_handler_level(self, level, filter=None):
975+
'''Set handler level for handlers attached to this logger.
976+
977+
:arg level: The new level.
978+
:arg filter: A callable accepting a single argument, which is the
979+
handler type as declared in ReFrame's configuration. If the filter
980+
is :obj:`None` then the level applies to all handlers, otherwise
981+
it will apply to all handlers that the filter return :obj:`True`.
982+
'''
983+
for h in self.logger.handlers:
984+
if filter is None or filter(h._rfm_type):
985+
h.setLevel(level)
986+
974987

975988
# A logger that doesn't log anything
976989
null_logger = LoggerAdapter()

reframe/frontend/cli.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,8 @@ def restrict_logging():
10461046
if options.describe_stored_sessions:
10471047
# Restore logging level
10481048
printer.setLevel(logging.INFO)
1049+
printer.set_handler_level(logging.WARNING,
1050+
lambda htype: htype != 'stream')
10491051
with exit_gracefully_on_error('failed to retrieve session data',
10501052
printer):
10511053
printer.info(jsonext.dumps(reporting.session_info(
@@ -1056,6 +1058,8 @@ def restrict_logging():
10561058
if options.describe_stored_testcases:
10571059
# Restore logging level
10581060
printer.setLevel(logging.INFO)
1061+
printer.set_handler_level(logging.WARNING,
1062+
lambda htype: htype != 'stream')
10591063
namepatt = '|'.join(n.replace('%', ' %') for n in options.names)
10601064
with exit_gracefully_on_error('failed to retrieve test case data',
10611065
printer):

reframe/frontend/reporting/storage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ def _db_store_report(self, conn, report, report_file_path):
228228

229229
return session_uuid
230230

231+
@time_function
231232
def store(self, report, report_file=None):
232233
with self._db_lock():
233234
with self._db_connect(self._db_file()) as conn:

0 commit comments

Comments
 (0)