fork download
  1. import logging
  2.  
  3. l = logging.getLogger('abc')
  4. l.setLevel(10)
  5. l.addHandler(logging.StreamHandler())
  6. l.info('ABC ONLY')
  7. print("")
  8.  
  9. logging.warn('root warning?')
  10. print("")
  11. l.info('abc duplicate?')
  12. print("")
  13.  
  14. l2 = logging.getLogger('cba')
  15. l2.setLevel(10)
  16. l2.addHandler(logging.StreamHandler())
  17. l2.info('cba duplicate?')
  18. print("")
  19.  
  20. l3 = logging.Logger("cab", logging.INFO)
  21. l3.addHandler(logging.StreamHandler())
  22. l3.info('cab, no duplicates')
Success #stdin #stdout #stderr 0.06s 10696KB
stdin
Standard input is empty
stdout



stderr
ABC ONLY
WARNING:root:root warning?
abc duplicate?
INFO:abc:abc duplicate?
cba duplicate?
INFO:cba:cba duplicate?
cab, no duplicates