microsoftgraph / microsoftgraph/msgraph-sdk-python-core

Logging to root logger

未关闭 适合新手
#1,078 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

status:waiting-for-triage type:bug
主要语言
Python
星标
288
派生
52
平均合并
8 小时 10 分钟
30 天内合并 PR
1

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

先从 src/msgraph_core/requests/batch_request_builder.py 第 70 行附近和 src/msgraph_core/tasks/large_file_upload.py 第 133 行附近开始,然后检查它们的 logger 是如何创建的。使用 logging.basicConfig() 重现错误的 batch request。当两个模块的日志消息都发送到模块级或包级 logger,而不是 root logger 时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
api
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
冷清
描述清晰度
描述清楚
新手友好度
75/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。