python logging to console exqmple

import sys
# ...
logging.getLogger().addHandler(logging.StreamHandler(sys.stdout))

Here is what the above code is Doing:
1. Importing the logging module
2. Setting the logging level to DEBUG
3. Creating a logger named ‘my_logger’
4. Adding a handler to the logger that will print to stdout