Colorize DeleteEvents for console watching

This commit is contained in:
agatha 2023-11-10 23:37:22 -05:00
parent 2d7fad2075
commit bb1ba3997f

View File

@ -12,6 +12,9 @@ def log_event(event):
repo = event.get('repo') repo = event.get('repo')
actor = event.get('actor') actor = event.get('actor')
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"]}') logger.info(f'{event_type}:\t{repo["name"]}, {actor["login"]}')
@ -26,7 +29,7 @@ def main():
if event['type'] in ['CreateEvent', 'DeleteEvent']: if event['type'] in ['CreateEvent', 'DeleteEvent']:
log_event(event) log_event(event)
time.sleep(10) time.sleep(5)
if __name__ == '__main__': if __name__ == '__main__':