Created
May 12, 2021 15:33
-
-
Save Abhayparashar31/14dc404313c724598c37a9c4c21212bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| logging.basicConfig(level=logging.DEBUG,filename='data.log', filemode='a', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', datefmt='%d/%m/%Y %H:%M:%S') | |
| name = str(input("Enter Your Name:\n")) | |
| logging.info(f"{name} has logged in successfully !!") | |
| -----------------data.log file output------------- | |
| 12/05/2021 21:01:37 - root - INFO - Abhay Parashar has logged in successfully !! | |
| 12/05/2021 21:02:47 - root - INFO - Karl has logged in successfully !! | |
| 12/05/2021 21:03:27 - root - INFO - Rahul has logged in successfully !! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment