From e5d809e7aae93be93720248699087cc1e01397a0 Mon Sep 17 00:00:00 2001 From: urihershgc Date: Tue, 8 Dec 2015 09:58:06 +0200 Subject: [PATCH] GC-4599: better logging of depth --- chaos_monkey/main.py | 5 +++-- chaos_monkey/monkey.py | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/chaos_monkey/main.py b/chaos_monkey/main.py index dc55cc40c..6774bf902 100644 --- a/chaos_monkey/main.py +++ b/chaos_monkey/main.py @@ -59,11 +59,12 @@ def main(): with open(config_file) as config_fo: json_dict = json.load(config_fo) WormConfiguration.from_dict(json_dict) - print "Configuration loaded: %r" % WormConfiguration.as_dict() except ValueError as e: print "Error loading config, using default: %s" % e else: - LOG.warning("Config file: %s wasn't found, using default" % config_file) + print("Config file: %s wasn't found, using default" % config_file) + + print "Loaded Configuration: %r" % WormConfiguration.as_dict() try: if MONKEY_ARG == monkey_mode: diff --git a/chaos_monkey/monkey.py b/chaos_monkey/monkey.py index 150494b04..0de821fc5 100644 --- a/chaos_monkey/monkey.py +++ b/chaos_monkey/monkey.py @@ -52,7 +52,6 @@ class ChaosMonkey(object): self._default_server = opts.server if opts.depth: WormConfiguration.depth = int(opts.depth) - LOG.debug("Selected depth is: %d" % WormConfiguration.depth) self._keep_running = True self._network = NetworkScanner() self._dropper_path = sys.argv[0] @@ -84,7 +83,10 @@ class ChaosMonkey(object): ControlClient.send_telemetry("system_info_collection", system_info) if 0 == WormConfiguration.depth: + LOG.debug("Reached max depth, shutting down") return + else: + LOG.debug("Running with depth: %d" % WormConfiguration.depth) for _ in xrange(WormConfiguration.max_iterations): ControlClient.keepalive()