Skip to content

Commit

Permalink
Changed default logging to INFO and added debug flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Campbell committed Sep 17, 2020
1 parent 5d54475 commit 7450253
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion utils/venv-manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# Configure the logger
logger_name = "venv-manager"
logger = logging.getLogger(logger_name)
logger.setLevel(logging.DEBUG)
logger.setLevel(logging.INFO)

# See: https://docs.python.org/3/library/logging.html#logrecord-attributes
log_message_format = "%(asctime)s %(name)s : [%(levelname)s] %(message)s"
Expand Down Expand Up @@ -70,6 +70,11 @@ def get_args() -> argparse.Namespace:
help="Action to perform.",
choices=("create", "delete", "reset")
)
parser.add_argument(
"--debug",
help="Print debug logs",
action="store_true",
)
return parser.parse_args()


Expand Down Expand Up @@ -229,6 +234,9 @@ def reset_environment() -> int:
args = get_args()
action = args.action

if args.debug:
logger.setLevel(logging.DEBUG)

if action == "create":
exit(create_environment())
elif action == "delete":
Expand Down

0 comments on commit 7450253

Please sign in to comment.