From 9e0effc1757cd1c5f839a90eb04c4a481d518207 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Fri, 19 Oct 2018 16:26:19 +1300 Subject: traffic: improve debug messages in traffic_replay tracebacks and less nonsense at higher debug levels. Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- script/traffic_replay | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/script/traffic_replay b/script/traffic_replay index f1e8372c8bb..6131ffad2e8 100755 --- a/script/traffic_replay +++ b/script/traffic_replay @@ -234,6 +234,9 @@ def main(): open(opts.traffic_summary, 'w').close() except IOError: # exception info will be added to log automatically + if debuglevel > 0: + import traceback + traceback.print_exc() logger.exception(("the supplied traffic summary destination " "(%s) is not writable" % opts.traffic_summary)) sys.exit() @@ -258,6 +261,9 @@ def main(): opts.duration, opts.replay_rate) except ValueError: + if debuglevel > 0: + import traceback + traceback.print_exc() logger.error(("Could not parse %s, which does not seem to be " "a model generated by script/traffic_learner." % model_file)) @@ -266,13 +272,6 @@ def main(): else: conversations = [] - if debuglevel > 5: - for c in traffic.seq_to_conversations(conversations): - for p in c.packets: - print(" ", p, file=sys.stderr) - - print('=' * 72, file=sys.stderr) - if opts.number_of_users and opts.number_of_users < len(conversations): logger.error(("--number-of-users (%d) is less than the " "number of conversations to replay (%d)" -- cgit v1.2.1