Resolve "Wrong formatting of errors in logs"
Description
The capture of output to log (stdout and stderr) was not formatting tracebacks properly. This MR fix the problem ;
it is only in bec-gui-server
.
Result is now like:
BECWidgetsCLIServer | 2024-08-14 18:02:58 | [ERROR] | Traceback (most recent call last):
File "/home/matias/dev/bec-widgets/bec_widgets/cli/server.py", line 118, in emit_heartbeat
messages.StatusMessage(name=self.gui_id, status=self.status, info={}),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/matias/miniconda3/envs/bec/lib/python3.11/site-packages/pydantic/main.py", line 164, in __init__
__pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
pydantic_core._pydantic_core.ValidationError: 1 validation error for StatusMessage
name
Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.4/v/string_type
('flush' is used to determine when a new message has to be logged, so no more multiple log lines per traceback)
Closes #298 (closed)
Edited by guijar_m