From 1350800405ad8d4544d76e1d27e176c0d2d040e2 Mon Sep 17 00:00:00 2001 From: brandons209 Date: Sun, 19 Jul 2020 16:54:35 -0400 Subject: [PATCH] remove print debug statements, and add in safeguards --- activitylog/activitylog.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/activitylog/activitylog.py b/activitylog/activitylog.py index 66d68c3..1569bff 100644 --- a/activitylog/activitylog.py +++ b/activitylog/activitylog.py @@ -552,12 +552,13 @@ class ActivityLogger(commands.Cog): with open(log, "r") as f: for line in reversed(list(f)): # time interval check: - current_time = parse_time_naive(line[:19]) - print("log current time: ", current_time, " log end time: ", end_time) + try: # shouldnt happen, but just in case + current_time = parse_time_naive(line[:19]) + except: + continue if start and start < current_time: continue if end_time > current_time: - print("breaking from log ", log) break if split_channels: @@ -568,7 +569,7 @@ class ActivityLogger(commands.Cog): # logs for a user from an entire guild works, as different channels # need to be checked. this doesn't save that much time when used # on a specific channel - print(messages) + # reverse messages to get correct order if split_channels: for ch_id in messages.keys():