microsoftgraph / microsoftgraph/msgraph-sdk-python-core

Logging to root logger

Open Beginner friendly
#1,078 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status:waiting-for-triage type:bug
Dominant language
Python
Stars
288
Forks
52
Avg merge
8h 10m
Merged PRs (30d)
1

Description

Describe the bug

The library logs to the root logger. As that's a widely-accepted bad practice, I guess it qualifies as a bug.

https://github.com/microsoftgraph/msgraph-sdk-python-core/blob/7c2fe2754ab0b84f390e7f7aaca050c560ff286a/src/msgraph_core/requests/batch_request_builder.py#L70

https://github.com/microsoftgraph/msgraph-sdk-python-core/blob/7c2fe2754ab0b84f390e7f7aaca050c560ff286a/src/msgraph_core/tasks/large_file_upload.py#L133

Expected behavior

All log messages should go to module- or package-specific loggers.

How to reproduce
import logging
logging.basicConfig()

# Send a bad batch request
SDK Version

1.3.8

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output
Configuration

No response

Other information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/msgraph_core/requests/batch_request_builder.py around line 70 and src/msgraph_core/tasks/large_file_upload.py around line 133, then inspect how their loggers are created. Reproduce the bad batch request with logging.basicConfig(). Done means log messages from both modules go to module- or package-specific loggers rather than the root logger.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
75/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.