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

[Feature] Logging level support #623

Open
szha opened this issue Jun 8, 2020 · 4 comments
Open

[Feature] Logging level support #623

szha opened this issue Jun 8, 2020 · 4 comments

Comments

@szha
Copy link
Member

szha commented Jun 8, 2020

Since dmlc-core logging is providing logging capability to several projects, it would be great to have the capability of setting logging levels which will improve the user experience in these projects.

apache/mxnet#16666
apache/mxnet#10492

The implementation should allow changing the logging level at runtime, and for disabled logging levels, the invocation should incur as little overhead as possible.

@hcho3
Copy link
Contributor

hcho3 commented Jun 11, 2020

@trivialfis This is a good time to port dmlc/xgboost#3982 to dmlc-core. I'd like to give it a try.

@trivialfis
Copy link
Member

trivialfis commented Jun 11, 2020

Not sure about that. I have a similar logging utility for my own use with some additional features like signal handling (printing a backtrace when segfault). But the more I use logging, the more I like about Python's logging module. If you want to create a new c++ logging library, I suggest we can look into that direction a little bit.

@hcho3
Copy link
Contributor

hcho3 commented Jun 11, 2020

I agree that Python logging is nice. However, we need need logging in the C++ layer. Also, there is a large body of existing code using LOG(INFO). That's why I'm inclined to port dmlc/xgboost#3982 to dmlc-core.

If you want to create a new c++ logging library, I suggest we can look into that direction a little bit.

Do you see a clear design flaw in dmlc/xgboost#3982?

@trivialfis
Copy link
Member

trivialfis commented Jun 11, 2020

@hcho3

Do you see a clear design flaw in dmlc/xgboost#3982?

Not yet, maybe no support for user defined verbosity level?

we need need logging in the C++ layer.

Yup, I meant we can implement something similar to python logging in c++. We can use shared pointer for holding child logger, define a similar logger manager etc. I haven't found any existing implementation online. But I believe it's possible.

lso, there is a large body of existing code using LOG(INFO). That's why I'm inclined to port dmlc/xgboost#3982 to dmlc-core.

Sure, that won't be a problem. But since dmlc-core is a common brick for other libraries. Giving it some more thought would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants