python logging

PHOTO EMBED

Mon Oct 31 2022 01:30:47 GMT+0000 (Coordinated Universal Time)

Saved by @janduplessis883 #graphs #data #jupyter_notebooks

import logging

logging.basicConfig(filename='codelogging.log', level=logging.DEBUG,
                format='%(asctime)s - %(message)s', datefmt='%d-%b-%y %H:%M:%S')

a_variable = 200

# for loop with logging
for i in range(100):
    x = print(i)
    logging.info('Iteriating')

logging.info('Script completed')
content_copyCOPY