diff --git a/turbo_hipster/worker_manager.py b/turbo_hipster/worker_manager.py index 4b2e02f..61a5f14 100644 --- a/turbo_hipster/worker_manager.py +++ b/turbo_hipster/worker_manager.py @@ -28,7 +28,7 @@ class ZuulManager(threading.Thread): To do this it implements its own gearman worker waiting for events on that manager. """ - log = logging.getLogger("worker_manager.GearmanManager") + log = logging.getLogger("worker_manager.ZuulManager") def __init__(self, config, tasks): super(ZuulManager, self).__init__() @@ -115,10 +115,12 @@ class ZuulClient(threading.Thread): self.register_functions() def register_functions(self): + self.debug.log("Register functions with gearman") for function_name, plugin in self.functions.items(): self.gearman_worker.registerFunction(function_name) def add_function(self, function_name, plugin): + self.debug.log("Add function, %s, to list" % function_name) self.functions[function_name] = plugin def stop(self): @@ -144,4 +146,5 @@ class ZuulClient(threading.Thread): def _handle_job(self): """ We have a job, give it to the right plugin """ + self.log.debug("We have a job, we'll launch the task now.") self.functions[self.job.name].start_job(self.job) diff --git a/turbo_hipster/worker_server.py b/turbo_hipster/worker_server.py index 7b71ca3..500f531 100755 --- a/turbo_hipster/worker_server.py +++ b/turbo_hipster/worker_server.py @@ -66,6 +66,7 @@ class Server(object): def load_plugins(self): """ Load the available plugins from task_plugins """ + self.log.debug('Loading plugins') # Load plugins for plugin in self.config['plugins']: self.plugins.append({ @@ -75,9 +76,11 @@ class Server(object): plugin['name']), 'plugin_config': plugin }) + self.log.debug('Plugin %s loaded' % plugin['name']) def start_gearman_workers(self): """ Run the tasks """ + self.log.debug('Starting gearman workers') self.zuul_client = worker_manager.ZuulClient(self.config, self.worker_name) @@ -102,6 +105,7 @@ class Server(object): self.zuul_manager.start() def exit_handler(self, signum): + self.log.debug('Exiting...') signal.signal(signal.SIGUSR1, signal.SIG_IGN) for task_name, task in self.tasks.items(): task.stop()