Skip to content

Change default logging to debug, stdout to info, use debug flag to ch… #60

Merged
merged 1 commit into from
Sep 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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