Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging regression introduced with 20.27.2 #2820

Open
sigma67 opened this issue Jan 10, 2025 · 2 comments
Open

Logging regression introduced with 20.27.2 #2820

sigma67 opened this issue Jan 10, 2025 · 2 comments

Comments

@sigma67
Copy link
Contributor

sigma67 commented Jan 10, 2025

Issue

Logging is being set up despite cli_run(setup_logging=False), causing virtualenv output to end up in INFO instead of DEBUG

Environment

args = [
    "--app-data",
    app_data_dir.as_posix(),
    "--seeder",
    "app-data",
    self.venv_dir.as_posix(),
    "--no-periodic-update",
]
cli_run(args=args, setup_logging=False)

Only occurs on 20.27.2 or later.

Output of the virtual environment creation

Previously output was logged to DEBUG. Now it is logged to INFO.

image

@gaborbernat
Copy link
Contributor

PR welcome 👍

@sigma67
Copy link
Contributor Author

sigma67 commented Jan 15, 2025

I had a look. In principle the new behavior seems more correct than the old one, which was just using the root logger.

In practice however, if you use cli_run from your app, you have no way of controlling the log level of the output now if you use setup_logging=False.

You can sidestep this by adding log filters, which we did to solve the issue for us. But it's not ideal. I suspect a good solution would require more extensive changes, but my Python logging-fu is not quite there yet I'm afraid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants