🔥 Welcome to my blog! Latest updates available now. Visit daily! 🔥 🔥 Click Here for Latest Updates – Visit My Blog 🔥
🔥 Latest Updates 📊 GP Grade Finder 📢 Government Services Info 🆕 New Schemes Updates

all messages will be written to log file

 In the above program only WARNING and higher level messages will be written to log file.

If we set level as DEBUG then all messages will be written to log file.

Copy code

Python

1) import logging

2) logging.basicConfig(filename='log.txt', level=logging.DEBUG)

3) print("Logging Module Demo")

4) logging.debug("This is debug message")

5) logging.info("This is info message")

6) logging.warning("This is warning message")

7) logging.error("This is error message")

8) logging.critical("This is critical message")

log.txt:

Copy code


1) DEBUG:root:This is debug message

2) INFO:root:This is info message

No comments:

Post a Comment

Thank you Very Much.For Given Comment

Free 51 Websites for Learning Education and Courses

🛑 లక్à°·à°²ు à°–à°°్à°šుà°ªెà°Ÿ్à°Ÿి à°•ాà°²ేà°œీà°²్à°²ో à°¨ేà°°్à°šుà°•ోà°²ేà°¨ి à°µిà°·à°¯ాలను, à°«్à°°ీà°—ా à°¨ేà°°్à°ªింà°šే 51 à°…à°¦్à°­ుతమైà°¨ à°µెà°¬్‌à°¸ైà°Ÿ్à°²ు ఇవే! 🛑 à°Žà°¡్à°¯ుà°•ేà°·à°¨్ and à°•ోà°°్à°¸ుà°²ు: Co...