From bb1ba3997f704b6fb62f943669580eef6338a013 Mon Sep 17 00:00:00 2001 From: agatha Date: Fri, 10 Nov 2023 23:37:22 -0500 Subject: [PATCH] Colorize DeleteEvents for console watching --- main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 7325fb4..ac9ccb7 100644 --- a/main.py +++ b/main.py @@ -12,7 +12,10 @@ def log_event(event): repo = event.get('repo') actor = event.get('actor') - logger.info(f'{event_type}:\t{repo["name"]}, {actor["login"]}') + if event_type == 'DeleteEvent': + logger.error(f'{event_type}:\t{repo["name"]}, {actor["login"]}') + else: + logger.info(f'{event_type}:\t{repo["name"]}, {actor["login"]}') def main(): @@ -26,7 +29,7 @@ def main(): if event['type'] in ['CreateEvent', 'DeleteEvent']: log_event(event) - time.sleep(10) + time.sleep(5) if __name__ == '__main__':