Skip to content

Commit

Permalink
Update comments, change minor formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
campb303 committed Jan 28, 2021
1 parent e068623 commit 25b33a6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions utils/venv-manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,24 @@
logger = logging.getLogger(logger_name)
logger.setLevel(logging.DEBUG)

# See: https://docs.python.org/3/library/logging.html#logrecord-attributes
# See Formatting Details: https://docs.python.org/3/library/logging.html#logrecord-attributes
# Example: Jan 28 2021 12:19:28 venv-manager : [INFO] Message
log_message_format = "%(asctime)s %(name)s : [%(levelname)s] %(message)s"
# See: https://docs.python.org/3.6/library/time.html#time.strftime
# See Time Formatting Details: https://docs.python.org/3.6/library/time.html#time.strftime
# Example: Jan 28 2021 12:19:28
log_time_format = "%b %d %Y %H:%M:%S"
log_formatter = logging.Formatter(log_message_format, log_time_format)

# Configure output to stdout
stream_handler = logging.StreamHandler()
stream_handler.setFormatter(log_formatter)
stream_handler.setLevel(logging.INFO)
logger.addHandler(stream_handler)

# Configure out to logfile
log_file_path = Path(WEBQUEUE2_DIR, "utils", f'{logger_name}.log')
file_handler = logging.FileHandler(log_file_path)
file_handler.setFormatter(log_formatter)

logger.addHandler(stream_handler)
logger.addHandler(file_handler)


Expand Down Expand Up @@ -210,6 +213,7 @@ def delete_environment() -> int:
logger.critical(f"Failed to delete virtual environment {VENV_NAME} at {VENV_DIR}. Exiting")
return 5


def reset_environment() -> int:
"""Resets a virtual environment for webqueue2
Expand Down

0 comments on commit 25b33a6

Please sign in to comment.