Skip to content

Silencing reframe's output also silences any other file handler #2784

@vkarak

Description

@vkarak

How to reproduce

Add this to your config:

            'handlers': [
                {
                    'type': 'file',
                    'name': 'reframe.out',
                    'level': 'info',
                    'format': '%(message)s'
                }
            ],

Then run reframe with -qq. Instead of producing the normal output in reframe.out, this is empty. If you remove the -qq options, then you get your output in reframe.out as expected.

The cause

The problem comes (most likely) from the following part of the code:

return [h for h in self.logger.handlers
if isinstance(h, logging.StreamHandler)]

called by the adjust_verbosity() logger's method. The problem is that a FileHandler is a StreamHandler in Python terms, therefore it is also silenced. The intent here was to silence only the stream handlers to suppress the output.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions