Created
March 29, 2022 01:14
-
-
Save ryanlong1004/232fd8041f09683d8a33a3679cd25f1d to your computer and use it in GitHub Desktop.
python logging basic
This file contains 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, | |
format="%(asctime)s %(name)-12s %(levelname)-8s %(message)s", | |
handlers=[logging.FileHandler("archive_results.log"), logging.StreamHandler()], | |
) | |
def main(): | |
pass | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment