Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding System Details to Log #513

Merged
merged 1 commit into from
Feb 8, 2018
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion src/watchmaker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import watchmaker.utils
from watchmaker import static
from watchmaker.exceptions import WatchmakerException
from watchmaker.logger import log_system_details
from watchmaker.managers.workers import (LinuxWorkersManager,
WindowsWorkersManager)
from watchmaker.utils import urllib
Expand Down Expand Up @@ -215,11 +216,12 @@ def __init__(self, arguments):
self.log_dir = arguments.pop('log_dir')
self.log_level = arguments.pop('log_level')

log_system_details(self.log)

# Get the system params
self.system = platform.system().lower()
self._set_system_params()

self.log.debug('System Type: %s', self.system)
self.log.debug('System Parameters: %s', self.system_params)

# All remaining arguments are worker_args
Expand Down
12 changes: 12 additions & 0 deletions src/watchmaker/logger/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ def make_log_dir(log_dir):
os.makedirs(log_dir)


def log_system_details(log):
"""Log details about the system Watchmaker is running on."""
log.info('System OS: %s', platform.system())
log.info('System Architecture: %s', platform.architecture())
log.info('System''s Release: %s', platform.release())
log.info('System''s Release Version: %s', platform.version())
log.info('Machine Type: %s', platform.machine())
log.info('Network Name: %s', platform.node())
log.info('Processor Name: %s', platform.processor())
log.info('Python Version: %s', platform.python_version())


def prepare_logging(log_dir, log_level):
"""
Prepare the logger for handling messages to a file and/or to stdout.
Expand Down