Skip to content

Commit

Permalink
Merge pull request #513 from KevinPlus3/add_log_details
Browse files Browse the repository at this point in the history
Adding System Details to Log
  • Loading branch information
lorengordon authored Feb 8, 2018
2 parents b3dcd54 + f3cfd40 commit 9160477
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
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

0 comments on commit 9160477

Please sign in to comment.