tinue / apa102-pi

Pure Python library to drive APA102 LED stripes; Use with Raspberry Pi.
GNU General Public License v2.0
202 stars 72 forks source link

Suppress printing to console if quiet param is set to True #53

Closed dasl- closed 1 year ago

dasl- commented 2 years ago

I have some code that repeatedly initializes an instance of the driver. It clutters logs or the console with these print messages. Hoping to make the print output configurable!

tinue commented 2 years ago

Thank you very much for your suggestion! I hope you are not offended when I don't accept the pull request "as is". The statements that you want to suppress are not really supposed to be there anymore ;-) Your pull request made me realise that I forgot to remove this debug output.

On the other hand, they are handy sometimes, because it is not always clear what is going on. What I would like to do is to convert any and all "print" statements from the library itself and from the samples into log statements.

As an additional parameter the library would then accept a log level.

dasl- commented 2 years ago

That makes sense to me!

Somewhat relatedly, I found problems with my pattern of repeatedly initializing an instance of the driver won't work, so I'm no longer doing that: https://github.com/dasl-/pifi/issues/33

tinue commented 2 years ago

Just wondering: Some YouTubers, e.g. Adrian's Digital Basement run a little TV like thingy in the background. It looks a bit like the frame in your video on the Github project page. Are they using your application?

About the resource issue: I am not sure if this can be changed / fixed in my part of the code. It might be something to do in the Adafruit library, or even in whatever C code that is used to interface between /dev/spidevx.y and Python. I'll keep it on the radar and will perform some experiments if I find the time.

Bildschirmfoto 2022-07-10 um 21 32 25
dasl- commented 2 years ago

Hmm, I doubt it... my project has not been "announced" anywhere so it's not known or used by many people outside of my circle of friends. Btw, I managed to track down a video of Adrian's thing here: https://youtu.be/yxYjAXRJkBw?t=465

One of these days I'll officially announce my project somewhere :)

About the resource issue: I am not sure if this can be changed / fixed in my part of the code.

Yea, from tracing the issue a bit I suspected as much. Given that I have a workaround for now, this doesn't seem like a big deal to me :)

tinue commented 1 year ago

As explained, I use logging now and the output should no longer be visible. Closing the request therefore.

dasl- commented 1 year ago

thank you!