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

reduce verbosity of some log messages #6073

Merged
merged 2 commits into from Sep 3, 2023
Merged

reduce verbosity of some log messages #6073

merged 2 commits into from Sep 3, 2023

Conversation

jameslamb
Copy link
Collaborator

Running a minimal example of cross-validation in the Python package (#6072 (comment)), I noticed some warning-level log messages that I believe should only be printed when users request more verbose logging.

[LightGBM] [Warning] Using self-defined objective function
[LightGBM] [Warning] Auto-choosing col-wise multi-threading, the overhead of testing was 0.006622 seconds.
You can set `force_col_wise=true` to remove the overhead.
[LightGBM] [Info] Total Bins 25500
[LightGBM] [Info] Number of data points in the train set: 6666, number of used features: 100
[LightGBM] [Warning] Using self-defined objective function
[LightGBM] [Warning] Auto-choosing col-wise multi-threading, the overhead of testing was 0.005703 seconds.
You can set `force_col_wise=true` to remove the overhead.
[LightGBM] [Info] Total Bins 25500
[LightGBM] [Info] Number of data points in the train set: 6666, number of used features: 100
[LightGBM] [Warning] Using self-defined objective function
[LightGBM] [Warning] Auto-choosing col-wise multi-threading, the overhead of testing was 0.006084 seconds.
You can set `force_col_wise=true` to remove the overhead.
[LightGBM] [Info] Total Bins 25500
[LightGBM] [Info] Number of data points in the train set: 6666, number of used features: 100
[LightGBM] [Warning] Using self-defined objective function
[LightGBM] [Warning] Using self-defined objective function
[LightGBM] [Warning] Using self-defined objective function

This PR proposes changing the level for those messages.

Notes for Reviewers

In my opinion, the following guidelines should be used to determine the level for log messages:

  • FATAL
    • answers "why did LightGBM raise a runtime exception?"
  • WARNING
    • alerts users to situations that might require their action (e.g. an unknown parameter, ignored parameters, inefficient configuration, etc.)
    • if possible, provides guidance on what specifics actions they should take
  • INFO
    • the default information LightGBM users should see under normal use of the project's public API
  • DEBUG
    • low-level details describing what LightGBM is doing, to help with troubleshooting and development

Do you agree? If so, I'll add that to the contributing documentation.

@jameslamb jameslamb changed the title reduce verbosity of some warnings reduce verbosity of some log messages Sep 3, 2023
@jameslamb jameslamb merged commit 1881a50 into master Sep 3, 2023
41 checks passed
@jameslamb jameslamb deleted the log-verbosity branch September 3, 2023 18:41
Copy link

github-actions bot commented Dec 6, 2023

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/microsoft/LightGBM/issues including a reference to this.

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

Successfully merging this pull request may close these issues.

None yet

2 participants