How to Capture and Log Tracebacks (Stack trace) in Python

Once you’ve caught an exception, you can capture and log a message with the exception info (including full stack traceback), using logging.exception() or logging.error(). With logging.exception(): With logging.error() we must set the exc_info keyword argument to True (default is False): In both cases, the Error occurred message is logged with level ERROR on the root […]

Pyenv Install and Select Multiple (global) Python Versions

In some scenarios you might have two (or more) different pieces of code in your source repository that may require different versions of Python to run. Like say 2.7 and 3.7 or 3.9 and 3.10. How can we make that happen with pyenv? To make multiple Python versions available at the same time in your […]