aflorithmic / apiaudio-python

api.audio Python SDK
https://www.api.audio
MIT License
25 stars 4 forks source link

introduced logging, SDK version control #64

Closed martinezpl closed 2 years ago

martinezpl commented 2 years ago

In the future, we can use the custom logging formate to send analytics reports about SDK usage, errors etc. :)

I tested this by adding Warning header in the source code - tested this way everything works as intended. Cannot write a test for this until we return Warning headers from our API.

Sjhunt93 commented 2 years ago

Also.

Can you add a disable warnings message? So customers can also choice to turn this off

Sjhunt93 commented 2 years ago

In general, I think the Logger needs to be designed as a singleton instance. Right now every class has a logger, but there is no difference. Instead, you could pass object name to raise_for_status, and then pass this to a 'log_warning' function?

Otherwise we are creating a seperate logger instance for each class

If you want to talk more about this we can