Created
June 30, 2020 16:15
-
-
Save myazdani/79ab68e262f082aca250f7f7600ec12e to your computer and use it in GitHub Desktop.
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 argparse | |
from loguru import logger | |
parser = argparse.ArgumentParser(description='Minimal example of dumping args into log file.') | |
parser.add_argument('--flag',type=str, | |
help='Some parameter flag') | |
args = parser.parse_args() | |
logger.add("file_{time}.log") | |
for arg, value in sorted(vars(args).items()): | |
logger.info("Argument {}: {}", arg, value) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment