-
Notifications
You must be signed in to change notification settings - Fork 700
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
[SDK] Setup Logging Verbose Level in TrainingClient #1946
Comments
Take this with a grain of salt, but my understanding is that in Python the expectation is that this kind of log level configuration is typically handled out of band. Take a look at httpx's logging documentation, for example: https://github.com/encode/httpx/blob/master/docs/logging.md#logging They log a TON of data with |
Sorry for the late reply @droctothorpe. I just want to avoid complexity for users who just use our SDK for the first time and can't see information that we want to log for them (e.g. Experiment has been created) until they modify the log level manually. |
@andreyvelich Is it really needed? Typically in SDK, logging is not generally required unless explictly enabled |
In that case, should we convert all of our logs to Kubernetes Python client logs some messages in debug mode: https://github.com/kubernetes-client/python/blob/master/kubernetes/client/rest.py#L235 |
@droctothorpe @johnugeorge Any comments on the above suggestion ? |
So, when |
Yes, that's right. So for users to see this they need to run the following:
Or, we can configure the default logger to be in DEBUG mode:
|
Isn't it a bad UX? The user needs to get the result whenever |
In that case, we can set the default logger to |
To followup on this thread, I created a new issue: #1944 (comment).
I agree, that we should have appropriate
logger
for the SDK (e.g.logging.getLogger(__name__)
) to not useroot
logger, but I still think that we should use logging to log some data for the user.The problem with
print
is that user can't identify from which library the output was generated, but with logging we can configure it.What do you think about this:
TrainingClient()
calledverbose
, and we can configure this parameter for various levels of logging: https://docs.python.org/3/library/logging.html#levels. We can start with (INFO
,WARNING
, andERROR
).TrainingClient
constructor. For example, forverbose=20
And then we are going to use
self.logger.info()
orself.logger.warning()
orself.logger.error()
when it is required to print some data.If user doesn't want to see any logs, they can always override it as follows:
Or provide
verbose=0
in theTrainingClient
parameter:WDYT @droctothorpe @johnugeorge @kuizhiqing ?
The text was updated successfully, but these errors were encountered: