apa102-pi icon indicating copy to clipboard operation
apa102-pi copied to clipboard

Suppress printing to console if quiet param is set to True

Open dasl- opened this issue 1 year ago • 4 comments

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!

dasl- avatar Jul 04 '22 05:07 dasl-

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.

tinue avatar Jul 09 '22 07:07 tinue

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

dasl- avatar Jul 09 '22 21:07 dasl-

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

tinue avatar Jul 10 '22 19:07 tinue

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 :)

dasl- avatar Jul 21 '22 02:07 dasl-

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

tinue avatar Jan 14 '23 15:01 tinue

thank you!

dasl- avatar Jan 16 '23 20:01 dasl-