Replies: 4 comments 3 replies
-
Hi @Mte90, This sounds like a rather general Python question. Since we are running on FastAPI and uvicorn, the stacktraces can get quite long. |
Beta Was this translation helpful? Give feedback.
-
If you are open to use Rich logging (https://rich.readthedocs.io) |
Beta Was this translation helpful? Give feedback.
-
It is something that you have to define on starlette initialization about the logging or in rich initialization. I think that it is something to be handled by nicegui. |
Beta Was this translation helpful? Give feedback.
-
NiceGUI allows to register custom exception handlers. So we can remove the default handler and add one that only prints the last 3 layers: app._exception_handlers.clear()
app.on_exception(lambda e: print(''.join(traceback.format_exception(e)[-3:]).strip())) Demo: def notify():
ui.notify(1/0)
def handle_click():
notify()
ui.button('Click me', on_click=handle_click) |
Beta Was this translation helpful? Give feedback.
-
Question
If there is an error in the code the amount of stuff showed is a lot and find the real error in the console output is very difficult.
There is a way to get only the first part of the error in the console?
Beta Was this translation helpful? Give feedback.
All reactions