-
Notifications
You must be signed in to change notification settings - Fork 702
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
mark lazy mode is deprecated and add LazyValue
for lazy format value
#1233
base: master
Are you sure you want to change the base?
Conversation
ci failed at codecov, not test/lint |
Hi @trim21, thanks for opening a PR. I understand it refers to #1207. I've been thinking about this lately, and to be honest I'm not very keen on the idea adding a new I would welcome a new API for lazy evaluated arguments if it also address #782. However, this is not necessarily easy. Another thing to consider is PEP 750. It's still draft and there's no guarantee that it will be accepted, but it could be interesting for our use case, without requiring a new API. |
also we have only sync api, I don't know there is a method to handle #782 |
Indeed, but it's possible to pass a We could imagine than when a template string is used, then Loguru will convert callable arguments, but only if the log level requires it. This would make the This PEP is actively discussed here.
I would prefer such API, yes. But still, that's a new method that increases the complexity of Loguru's API, for a marginal gain in my opinion.
Yes, unfortunately I don't know how to integrate it either. |
personal I think this is confusing and dangerous behaviour to call callable in arguments unless explicit specified with lazy or something |
No description provided.