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

Incremental improvement to application logging #5505

Merged
merged 4 commits into from
Apr 27, 2022

Conversation

abn
Copy link
Member

@abn abn commented Apr 26, 2022

This builds on top of #5503 by

  1. Handling record formatting correctly. Without this change log.info("%s", "hello") will be logged as %s.
  2. Log only poetry specific messages unless -vvv is used.
  3. Prefix third-party packages with logger name for easy debugging.
  4. Ensure use of simple log formatting for testing.

Example output with -vv

Using virtualenv: /tmp/foobar/.venv
Updating dependencies
Resolving dependencies...
   1: fact: foobar is 0.1.0
   1: derived: foobar
   1: fact: foobar depends on httpx (^0.22.0)
   1: selecting foobar (0.1.0)
   1: derived: httpx (>=0.22.0,<0.23.0)
torch: Authorization error accessing https://download.pytorch.org/whl/cu113/httpx/

Example output with -vvv

Loading configuration file /home/abn/.config/pypoetry/config.toml
Loading configuration file /home/abn/.config/pypoetry/auth.toml
[keyring.backend] Loading KWallet
[keyring.backend] Loading SecretService
[keyring.backend] Loading Windows
[keyring.backend] Loading chainer
[keyring.backend] Loading libsecret
[keyring.backend] Loading macOS
Adding repository torch (https://download.pytorch.org/whl/cu113) and setting it as secondary
Using virtualenv: /tmp/foobar/.venv
Updating dependencies
Resolving dependencies...
   1: fact: foobar is 0.1.0
   1: derived: foobar
   1: fact: foobar depends on httpx (^0.22.0)
   1: selecting foobar (0.1.0)
   1: derived: httpx (>=0.22.0,<0.23.0)
[urllib3.connectionpool] Starting new HTTPS connection (1): pypi.org:443
[urllib3.connectionpool] https://pypi.org:443 "GET /pypi/httpx/json HTTP/1.1" 304 0
PyPI: No release information found for httpx-0.0.1, skipping
PyPI: 1 packages found for httpx >=0.22.0,<0.23.0
[urllib3.connectionpool] Starting new HTTPS connection (1): download.pytorch.org:443
[urllib3.connectionpool] https://download.pytorch.org:443 "GET /whl/cu113/httpx/ HTTP/1.1" 403 None
torch: Authorization error accessing https://download.pytorch.org/whl/cu113/httpx/

@abn abn requested a review from a team April 26, 2022 18:36
@abn abn force-pushed the improve-logging branch 2 times, most recently from 22c8fe5 to ca5dae6 Compare April 26, 2022 20:23
@abn abn merged commit fafe0b7 into python-poetry:master Apr 27, 2022
@abn abn deleted the improve-logging branch April 27, 2022 07:35
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants