#feat/1 - code cleanup for final release, part 1
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import logging
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
|
||||
def logging_error(msg: str, *args) -> None:
|
||||
"""
|
||||
Log an error message according to current logging for 'ERROR' level.
|
||||
Add module name, line and function name where the error occurred, on single line.
|
||||
Args:
|
||||
msg (str): The error message to log.
|
||||
"""
|
||||
_tb = traceback.extract_tb(sys.exc_info()[2])[-1]
|
||||
logging.error(f" [E] module '{_tb.filename}', line {_tb.lineno}, function '{_tb.name}': {msg}", *args)
|
||||
Reference in New Issue
Block a user