mirror of
https://git.juggalol.com/agatha/gitmon.git
synced 2024-12-26 23:56:39 +00:00
Add custom log levels. Closes #1
This commit is contained in:
parent
bf34654a46
commit
73e5a63565
@ -2,6 +2,9 @@
|
||||
import sys
|
||||
from loguru import logger
|
||||
|
||||
logger.level('CREATE', no=34, color='<green>')
|
||||
logger.level('DELETE', no=35, color='<red>')
|
||||
|
||||
|
||||
def setup_logger():
|
||||
logger.remove()
|
||||
|
4
main.py
4
main.py
@ -16,9 +16,9 @@ def log_event(event):
|
||||
actor = event.get('actor')
|
||||
|
||||
if event_type == 'DeleteEvent':
|
||||
logger.error(f'{event_type}:\thttps://github.com/{repo["name"]}, {actor["login"]}')
|
||||
logger.log('DELETE', f'{event_type}:\thttps://github.com/{repo["name"]}, {actor["login"]}')
|
||||
else:
|
||||
logger.info(f'{event_type}:\thttps://github.com/{repo["name"]}, {actor["login"]}')
|
||||
logger.log('CREATE', f'{event_type}:\thttps://github.com/{repo["name"]}, {actor["login"]}')
|
||||
|
||||
|
||||
def main():
|
||||
|
Loading…
Reference in New Issue
Block a user