diff --git a/src/catchup.py b/src/catchup.py index a2fa21b..be70804 100644 --- a/src/catchup.py +++ b/src/catchup.py @@ -67,6 +67,7 @@ async def get_cross_tweets_online(): print("Unhandled error occurred while pulling tweets.") traceback.print_exc() with open(working_path(file="error_catchup.txt"), "a") as f: + f.write(f"-------[{get_current_datetime_pretty()}]-------\n") f.write(f"Error getting tweets from user {dbg_curr_user}\n") traceback.print_exc(file=f) safe_to_post_tweets = False diff --git a/src/util.py b/src/util.py index f06bc9c..e1c8a97 100644 --- a/src/util.py +++ b/src/util.py @@ -61,6 +61,10 @@ def get_current_date(): return datetime.today().strftime("%Y-%m-%d") +def get_current_datetime_pretty(): + return datetime.now().strftime("%Y-%m-%d %H:%M:%S %Z") + + def get_key_from_value(d: dict, val): keys = [k for k, v in d.items() if v == val] if keys: