Skip to content

[python-package] Show true origin of logger info/warning#6878

Closed
tmct wants to merge 2 commits intolightgbm-org:masterfrom
tmct:patch-1
Closed

[python-package] Show true origin of logger info/warning#6878
tmct wants to merge 2 commits intolightgbm-org:masterfrom
tmct:patch-1

Conversation

@tmct
Copy link
Copy Markdown

@tmct tmct commented Mar 31, 2025

No description provided.

@jameslamb jameslamb changed the title Show true origin of logger info/warning [python-package] Show true origin of logger info/warning Mar 31, 2025
Copy link
Copy Markdown
Member

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your interest in LightGBM!

Before we review this any further, please:

_LOGGER = logger
_INFO_METHOD_NAME = info_method_name
_WARNING_METHOD_NAME = warning_method_name
_LOG_KWARGS = {"stacklevel": 2} if isinstance(logger, logging.Logger) else {}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please make this an if-else instead of a 1-liner. We have a slight preference for that, for readability.

@shiyu1994
Copy link
Copy Markdown
Collaborator

/AzurePipelines run

@jameslamb
Copy link
Copy Markdown
Member

It's been about a month, I am going to close this due to lack of response.

@tmct if you'd like to contribute in the future, you are welcome to re-open this! If you do, please add the things I asked for in #6878 (review).

@jameslamb jameslamb closed this Apr 28, 2025
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been automatically locked since there has not been any recent activity since it was closed.
To start a new related discussion, open a new issue at https://github.com/lightgbm-org/LightGBM/issues including a reference to this.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants