Christopher Juckins

SysAdmin Tips, Tricks and other Software Tools

User Tools

Site Tools


python_notes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
python_notes [2019/09/16 15:12] juckinspython_notes [2019/09/16 15:30] juckins
Line 45: Line 45:
      
 [[https://docs.python.org/3/howto/logging.html|Logging in python]] [[https://docs.python.org/3/howto/logging.html|Logging in python]]
 +
 +  logging.basicConfig(format='%(asctime)s %(message)s', filename=log_file, level=logging.DEBUG)
 +  logging.debug('This message should go to the log file')
 +  logging.info('So should this')
 +  logging.warning('And this, too')
 +
  
 [[https://realpython.com/python-pep8/|Write beautiful python code with PEP-8]] [[https://realpython.com/python-pep8/|Write beautiful python code with PEP-8]]
python_notes.txt · Last modified: 2023/04/05 08:56 by juckins