2
2
Fork
You've already forked overpass-api-python-wrapper
2

Improve logging setup #193

Merged
mvexel merged 1 commit from tpikonen/overpass-api-python-wrapper:logging into main 2026年05月02日 22:02:11 +02:00
Contributor
Copy link

Setting debug=True when initializing API calls logging.basicConfig() which causes an existing logging setup (formats etc.) to be cleared. This is pretty bad when trying to use this module as a library.

This MR sets up debug logging without making this call and makes some additional small fixes.


Do not call logging.basicConfig(), it should be called by the user of
this library.

Get a logger instance on API object init and use it for logging.

Set up request and response printing when debug=True as described here:
https://docs.python-requests.org/en/latest/api/#api-changes

Set our logging level to DEBUG when debug=True.

Setting `debug=True` when initializing `API` calls `logging.basicConfig()` which causes an existing logging setup (formats etc.) to be cleared. This is pretty bad when trying to use this module as a library. This MR sets up debug logging without making this call and makes some additional small fixes. --- Do not call logging.basicConfig(), it should be called by the user of this library. Get a logger instance on API object init and use it for logging. Set up request and response printing when debug=True as described here: https://docs.python-requests.org/en/latest/api/#api-changes Set our logging level to DEBUG when debug=True.
Do not call logging.basicConfig(), it should be called by the user of
this library.
Get a logger instance on API object init and use it for logging.
Set up request and response printing when debug=True as described here:
https://docs.python-requests.org/en/latest/api/#api-changes
Set our logging level to DEBUG when debug=True.

Thanks! I'll let you know when I had a chance to review.

Thanks! I'll let you know when I had a chance to review.

Thanks for the patch. This no longer appears mergeable against the current main as-is.

From local inspection:

  • current main is 2d6de6b
  • this PR head is 5d7a1c1
  • the merge base is e1a7b43

Could you please rebase this PR onto the current main (or retarget it if a different branch is now the intended base)? That will make it clear whether the logging fix can still be applied cleanly.

Thanks for the patch. This no longer appears mergeable against the current `main` as-is. From local inspection: - current `main` is `2d6de6b` - this PR head is `5d7a1c1` - the merge base is `e1a7b43` Could you please rebase this PR onto the current `main` (or retarget it if a different branch is now the intended base)? That will make it clear whether the logging fix can still be applied cleanly.

Correction: my previous rebase note was based on a stale local origin/main ref. After refreshing from Codeberg, the current remote main is still e1a7b43, which is also the merge base of this PR. So this PR does appear to be based on the current target branch after all. Sorry for the noise.

Correction: my previous rebase note was based on a stale local `origin/main` ref. After refreshing from Codeberg, the current remote `main` is still `e1a7b43`, which is also the merge base of this PR. So this PR does appear to be based on the current target branch after all. Sorry for the noise.
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mvexel/overpass-api-python-wrapper!193
Reference in a new issue
mvexel/overpass-api-python-wrapper
No description provided.
Delete branch "tpikonen/overpass-api-python-wrapper:logging"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?