How to properly log (logging) instead of print?
Answer
•import logging; log = logging.getLogger(__name__).
•Use levels: debug/info/warning/error.
•Configure format and handler.
•Do not log secrets (tokens/passwords).
•Do not configure root-logger in the library.
Was this answer helpful?