#feat/1 - code cleanup for final release, part 1

This commit is contained in:
Stanislav Hejny
2025-04-17 13:20:56 +01:00
parent 7bc92f9614
commit a8d82b1e3d
5 changed files with 89 additions and 75 deletions
+14
View File
@@ -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)