Closed vedant-z closed 8 months ago
You don't need to open a new PR for each change, you can push commits to the same branch. If you need help with this, just let me know.
In terms of the code, the ArgumentParser
is already being instantiated within main.py
and the arguments are added within get_args
. You can add the verbose flag there. We already have a -v
flag so you can name the verbose flag verbose
, but not -v
.
The arguments are read by the perform_action
function, you read the argus value there and set the basicConfig
for logging which will be applied everywhere.
The log.py
file can be removed once this is done, it's redundant.
You've added the argument correctly so great work there, but it still needs to be read so that the logging configuration can be set. My suggestion would be to add a conditional statement to perform_action
in main.py
that checks for arg.verbose
and then sets the basicConfig for logging appropriately.
You could use something like
log_level = logging.INFO
if args.verbose:
log_level = logging.DEBUG
logging.basicConfig(level=log_level, format='%(asctime)s - %(levelname)s - %(message)s', datefmt='%d-%b-%y %H:%M:%S')
This will set the default log_level to info and use debug for verbose logging.
Issue #292