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,7 +12,10 @@ def log_event(event):
repo = event.get('repo') repo = event.get('repo')
actor = event.get('actor') 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(): def main():
@ -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__':