- You have to use the log('Your Message') everywhere, where you want to log. The print_function stays still the print_function and does not change.
- You're using Python 2.7, which is deprecated 2020. Upgrade to Python 3.7. In Python 2.7 print is not a function, it's a statement and the parenthesis around the arguments are recognized as a tuple and a tuple has no keyword assignment. If you need to stay with legacy Python, you should use the imports from __future__:
from __future__ import print_function
Then you must use everywhere print as a function
The logging module is doing a better job. You've more control about different handlers and formatting.
You could also try https://github.com/Delgan/loguru
The boiler-plate code has been removed :-)
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!