Use logging instead of print. (@Ir1d you brought this up before)
Suggested by @adefazio
hey @williamFalcon could you just guide me to the files that needs print to be changed to logging and i'll do it. Thanks.
I think that we were talking about it already a few months back :] happy to see it pass O:-)
@williamFalcon could you draw what kind of messages should be info and debug?
@humandotlearning please use lazy formating
logging.info('Epoch %05d: %s did not improve', epoch + 1, self.monitor)
I suppose f-strings are preferred?
should we exposure logger as an option, since I prefer loguru, while others might like something else.
Given a second thought, what about adding a info and some debug function into LightningLoggerBase?
Something like: self.logger.info() , and users will be free to use whatever logger they like by specifying in custom logger.
However: after a quick search. their are certain functions which dont have access to LoggerBase at this moment. For example the callback
Please use f-strings!
okay as @williamFalcon suggested i'll go with f-string. I have done a performance comparison if anyone is interested.
https://colab.research.google.com/drive/1J6-SFq5nDGTYDH7GIpzixbjYS0UvZ30E
@humandotlearning @lr1d already started in #457
actually I'm stuck with how to let users select custom printing function? Any idea on this?
@Ir1d what do you mean by custom printing function? logging.info/debug/warning / print()... ?
@Borda I mean using other libraries such as loguru. But yes, what if someone wants to use debug/warning or other stuffs
it is nice library, but I would follow the same strategy as for PyTorch, do not include anything extra until it is really needed so I would sta just with the standard logging , @williamFalcon ?
@williamFalcon @Ir1d just noticed that using f-string makes unable to use python 3.5 and lower...
https://www.reddit.com/r/Python/comments/5xswh9/can_you_import_fstrings_in_python_35/
https://stackoverflow.com/questions/55182209/f-string-invalid-syntax-in-python-3-5
@Borda Yes, and I believe @williamFalcon is aware of this fact :joy:
It's possible to use f2format to convert f-strings to str.format, to be compatible with Python <=3.5
@ethanjperez amazing haha. it鈥檚 finally happening :)
i think it鈥檚 a good place to start for a PR @ethanjperez ?
@ethanjperez it is true, but I am not sure that we do not want to have this "".format() formatting...
it works exactly as it is written in the package description:
# the original code
var = f'foo{(1+2)*3:>5}bar{"a", "b"!r}boo'
# after `f2format`
var = 'foo{:>5}bar{!r}boo'.format((1+2)*3, ("a", "b"))
@williamFalcon ^^
Most helpful comment
I suppose f-strings are preferred?
should we exposure logger as an option, since I prefer loguru, while others might like something else.