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

Implement optional logging configuration in the ABI. #14

Open
AraHaan opened this issue May 22, 2024 · 2 comments
Open

Implement optional logging configuration in the ABI. #14

AraHaan opened this issue May 22, 2024 · 2 comments
Assignees
Labels
external This has to do with something outside of the PyAwaitable core feature New feature or request

Comments

@AraHaan
Copy link
Collaborator

AraHaan commented May 22, 2024

Proposal:

I feel like the ABI should have an awaitable_set_debug() ABI function that users can call when they compile their extension with _DEBUG/DEBUG defined:

  • In debug when that ABI is called it sets an internal only global structure that configures logging to a file named pyawaitable.log in the current active directory of the running python interpreter.
    • It would then from within any and all following ABI calls logs all reference counts (in case of memory leak or decref too much), errors (if applicable), results (say ones set from SetResult, and also log if callbacks fail so it can help pinpoint which callback might have a problem (or causes an Access Violation to make debugging easier in user code).

I feel like this sort of ABI would be great and must be set before the init ABI function is called. Any additional calls to it does nothing.

@AraHaan AraHaan added the feature New feature or request label May 22, 2024
@ZeroIntensity ZeroIntensity added the external This has to do with something outside of the PyAwaitable core label May 22, 2024
@ZeroIntensity
Copy link
Owner

I think this is feasible. Would you mind implementing it?

@AraHaan
Copy link
Collaborator Author

AraHaan commented May 22, 2024

I can try yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external This has to do with something outside of the PyAwaitable core feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants