mirror of
https://github.com/bellingcat/auto-archiver-api.git
synced 2026-06-11 04:58:33 +03:00
Format and lint shared directory (#64)
This commit is contained in:
@@ -8,7 +8,9 @@ logger.add("logs/api_logs.log", retention="30 days")
|
||||
logger.add("logs/error_logs.log", retention="30 days", level="ERROR")
|
||||
|
||||
|
||||
def log_error(e: Exception, traceback_str: str = None, extra:str = ""):
|
||||
if not traceback_str: traceback_str = traceback.format_exc()
|
||||
if extra: extra = f"{extra}\n"
|
||||
def log_error(e: Exception, traceback_str: str = None, extra: str = ""):
|
||||
if not traceback_str:
|
||||
traceback_str = traceback.format_exc()
|
||||
if extra:
|
||||
extra = f"{extra}\n"
|
||||
logger.error(f"{extra}{e.__class__.__name__}: {e}\n{traceback_str}")
|
||||
|
||||
Reference in New Issue
Block a user