Skip to content

info messages logged as warnings #2727

@pdagosto

Description

@pdagosto

Snakemake version
7.32.4 with Python 3.9.16

Describe the bug
I am using a log handler script to filter out snakemake messages I'm not interested in. I also have my own Logger class for formatting purposes.

I have noticed that snakemake messages with a level of "info" are being logged as warnings. In looking at the logging.py module for snakemake I see that the code is indeed logging warnings for messages with a level of "info" and is also logging messages with a level of "warning" as critical. Here are lines 579-590 of snakemake/logging.py:

            if level == "info":
                self.logger.warning(msg["msg"])
            if level == "warning":
                self.logger.critical(msg["msg"])
            elif level == "error":
                self.logger.error(msg["msg"])
            elif level == "debug":
                self.logger.debug(msg["msg"])
            elif level == "resources_info":
                self.logger.warning(msg["msg"])
            elif level == "run_info":
                self.logger.warning(msg["msg"])

Is there a reason for this elevation of levels?

Logs

Minimal example

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions