Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better logging feedback (more assertions) #1216

Open
zaczhuozhang opened this issue Nov 29, 2023 · 5 comments
Open

Better logging feedback (more assertions) #1216

zaczhuozhang opened this issue Nov 29, 2023 · 5 comments

Comments

@zaczhuozhang
Copy link

zaczhuozhang commented Nov 29, 2023

Feature Request

As a user, I want the terminal logging to be more informational for easier debugging and tracing.

such output, and many others, are hard to trace the bug as a general user:

File "C:\Users\zaczz\miniconda3\envs\compas-dev\lib\site-packages\compas\datastructures\halfedge\halfedge.py", line 439, in add_face
    if u not in self.halfedge[v]:
KeyError: 3

while developers can make this more informational by using logging tools like loguru and enumerating possible exceptions during the development.

also, I would suggest more rigorous type hint.

@gonzalocasas
Copy link
Member

Since we are talking about core here, I would not use logging or any derived tool, but instead I would add more assertions/checks and throw exceptions with meaningful messages

@zaczhuozhang
Copy link
Author

agree, more assertions/checks with more information would help.

@gonzalocasas
Copy link
Member

Oh don't close it, please, just update it to request more assertions instead of logging

@zaczhuozhang
Copy link
Author

sure

@zaczhuozhang zaczhuozhang reopened this Nov 29, 2023
@zaczhuozhang zaczhuozhang changed the title Better logging feedback Better logging feedback (more assertions) Nov 29, 2023
@jf---
Copy link
Contributor

jf--- commented Apr 8, 2024

by using logging tools like loguru

+1 loguru makes logging a joy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants