Packages list
* list installed packages
* dev
* Update loggers.py
Change debug to info in common message
* fix pep
* doc
@@ -438,10 +438,33 @@ def configure_moler_main_logger():
_get_moler_version())
logger.info(msg)
logger.info("More logs in: {}".format(_logging_path))
+ _list_libraries(logger=logger)
global _main_logger
_main_logger = logger
+def _list_libraries(logger):
+ """
+ List installed Python libraries to log file.
+ :param logger: logger to log.
+ :return: None
+ """
+ installed_packages = pkg_resources.working_set
+ packages = dict()
+ re_moler = re.compile("moler")
+
+ for dist in installed_packages:
+ packages[dist.project_name] = dist.version
+
+ logger.info("Installed packages:")
+ for dist_name in sorted(packages.keys()):
+ msg = "'{}':'{}'.".format(dist_name, packages[dist_name])
+ if re.search(re_moler, dist_name):
+ logger.info(msg)
+ else:
+ logger.debug(msg)
+
+
def configure_runner_logger(runner_name):
"""Configure logger with file storing runner's log"""
logger_name = 'moler.runner.{}'.format(runner_name)
