Skip to content

Commit

Permalink
Merge pull request #60 from ECN/enhancement-venv-manager-log-debug-to…
Browse files Browse the repository at this point in the history
…-file

Change default logging to debug, stdout to info, use debug flag to ch…
  • Loading branch information
campb303 authored Sep 28, 2020
2 parents 29a8c71 + 15ea8ff commit ae7d71b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions 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.INFO)
logger.setLevel(logging.DEBUG)

# See: https://docs.python.org/3/library/logging.html#logrecord-attributes
log_message_format = "%(asctime)s %(name)s : [%(levelname)s] %(message)s"
Expand All @@ -44,6 +44,7 @@

stream_handler = logging.StreamHandler()
stream_handler.setFormatter(log_formatter)
stream_handler.setLevel(logging.INFO)

log_file_path = Path(WEBQUEUE2_DIR, "utils", f'{logger_name}.log')
file_handler = logging.FileHandler(log_file_path)
Expand Down Expand Up @@ -235,7 +236,7 @@ def reset_environment() -> int:
action = args.action

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

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

0 comments on commit ae7d71b

Please sign in to comment.