using stack info in logging

This commit is contained in:
Florian Förster 2025-03-20 14:06:32 +01:00
parent a4604d3dc4
commit 16c926c2e7
2 changed files with 2 additions and 6 deletions

View File

@ -1,6 +1,6 @@
[project] [project]
name = "delta-barth" name = "delta-barth"
version = "0.3.1" version = "0.3.2"
description = "prognosis module" description = "prognosis module"
authors = [ authors = [
{name = "Florian Förster", email = "f.foerster@d-opt.com"}, {name = "Florian Förster", email = "f.foerster@d-opt.com"},

View File

@ -1,6 +1,5 @@
from __future__ import annotations from __future__ import annotations
import traceback
import typing as t import typing as t
from collections.abc import Callable from collections.abc import Callable
from functools import wraps from functools import wraps
@ -239,12 +238,9 @@ def wrap_result(
status = ResultWrapper( status = ResultWrapper(
result=NotSet(), exception=err, code_on_error=code_on_error result=NotSet(), exception=err, code_on_error=code_on_error
) )
fmt_exc = traceback.format_exception(err)
exc_str = "".join(fmt_exc)
logger.error( logger.error(
"An exception in routine %s occurred:\n%s", "An exception in routine %s occurred, stack trace:",
func.__name__, func.__name__,
exc_str,
stack_info=True, stack_info=True,
) )