Advertisement
VanoHa

logging

Jan 25th, 2023
786
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. import logging
  2.  
  3. file_log = logging.FileHandler('thecode.log')
  4. console_out = logging.StreamHandler()
  5. logging.basicConfig(handlers=(file_log, console_out), level=logging.DEBUG)
  6. logging.info('declarete veariables')
  7. jun = 1
  8. day = 30
  9. month = range(1, day)
  10. logging.warning('enter in to the loop')
  11. for current_day in month:
  12.     jun = jun * 2
  13.     logging.debug('amount juns:' +str(jun))
  14. #print(jun)
  15. new_jun = 2
  16. new_day = 0
  17. logging.warning('enter in to the second loop')
  18. while new_jun <= jun:
  19.     new_jun = new_jun * 2
  20.     logging.debug('amount new_juns:' +str(jun))
  21.     new_day = new_day + 1
  22. print(new_day)
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement