From 00a1f1eeb9b7c718eb451e366d7d42a8ecc9c6c0 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Sat, 15 Oct 2011 01:41:11 +0200 Subject: [PATCH] ++ more host prefixing log code Signed-off-by: Nico Schottelius --- lib/cdist/config_install.py | 4 ++-- lib/cdist/core/explorer.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/cdist/config_install.py b/lib/cdist/config_install.py index ce7c5736..a71998f7 100644 --- a/lib/cdist/config_install.py +++ b/lib/cdist/config_install.py @@ -70,8 +70,8 @@ class ConfigInstall(object): start_time = time.time() self.deploy_to() self.cleanup() - self.log.info("Finished run of %s in %s seconds", - self.context.target_host, time.time() - start_time) + self.log.info("Finished run in %s seconds", + time.time() - start_time) def stage_prepare(self): """Do everything for a deploy, minus the actual code stage""" diff --git a/lib/cdist/core/explorer.py b/lib/cdist/core/explorer.py index 90201072..b4f8531e 100644 --- a/lib/cdist/core/explorer.py +++ b/lib/cdist/core/explorer.py @@ -25,9 +25,6 @@ import os import cdist -log = logging.getLogger(__name__) - - ''' common: runs only remotely, needs local and remote to construct paths @@ -67,13 +64,16 @@ class Explorer(object): """ def __init__(self, target_host, local, remote): self.target_host = target_host + + self.log = logging.getLogger(target_host) + self.local = local self.remote = remote self.env = { '__target_host': self.target_host, '__explorer': self.remote.global_explorer_path, } - if log.getEffectiveLevel() == logging.DEBUG: + if self.log.getEffectiveLevel() == logging.DEBUG: self.env.update({'__debug': "yes" }) ### global @@ -106,7 +106,7 @@ class Explorer(object): """Transfer the type explorers for the given type to the remote side.""" if cdist_type.explorers: if cdist_type.explorers_transferred: - log.debug("Skipping retransfer of type explorers for: %s", cdist_type) + self.log.debug("Skipping retransfer of type explorers for: %s", cdist_type) else: source = os.path.join(self.local.type_path, cdist_type.explorer_path) destination = os.path.join(self.remote.type_path, cdist_type.explorer_path)