0

I'm not sure how to explain this question because my english is no so god. But i will try with the sample source code.

So i am on some open-embedded system where system debug log can be enabled or disabled. If is enabled all events from boot to reboot are written into debug log in /home/root/logs/ folder. So any code which i wrote in my python app is written to this debug log. How to avoid this?

Let me explain with some piece of code. startStream is my code:

def startStream(myUrl):
    # PlayStream isn't my code. it's imported from somewhere:
    from SomeFolder.SomeApp.SomeFile import PlayStream
    PlayStream(myUrl)
def PlayStream(url):
    print(url)
    session.PlayService(url)

So as you can see, PlayStream function will write down my url into debug log, but i don't want this. I don't want to people see my links (in this case). Let me explain that SomeFolder.SomeApp.SomeFile import PlayStream is a imaginary import and function name and can be a lot of similar function anywhere across the system.

How to avoid that third party functions/methods from python or from other languages wrote my python stuff into system debug log?


For example if i call servicemp3 to play my url, this the output from servicemp3.cpp in debug-log:

15:26:57.0339 {   } /usr/lib/python2.7/site-packages/twisted/python/util.py:815 untilConcludes 2022-04-09 15:26:57+0200 [-] playing [b]4097:0:0:0:0:0:0:0:0:0:http%3a//blahblah.net%3a80/a/movie?action=stream&id=0005&hash=qwertzuiop:Eaux Profondes[/b]
15:26:57.0371 [   ] service/servicemp3.cpp:195 create_gstreamer_sinks [eServiceFactoryMP3] **** dvb_audiosink created ***
15:26:57.0389 [   ] service/servicemp3.cpp:204 create_gstreamer_sinks [eServiceFactoryMP3] **** dvb_videosink created ***
15:26:57.0404 [   ] service/servicemp3.cpp:213 create_gstreamer_sinks [eServiceFactoryMP3] **** dvb_subsink created ***
15:26:57.0404 [   ] service/servicemp3.cpp:233 play [eServiceFactoryMP3] ****new play service total services played is 1****
15:26:57.0408 [   ] service/servicemp3.cpp:725 eServiceMP3 [eServiceMP3] playbin uri=[b]http://blahblah.com:80/a/movie?action=stream&id=0005&hash=qwertzuiop[/b]
15:26:57.0453 [   ] service/servicemp3.cpp:959 start [eServiceMP3] *** starting pipeline ****

The same thing is for exteplayer3 or any player.

The point is how to avoid prints from third party apps?

CncMess
  • 23
  • 5
  • If anything means for you guys: I have already tried to redirect print which i want to hide from stdout to file or string buffer, but it seems nothing works. Solution form here doesn't work. https://stackoverflow.com/a/1218951/9157441 – CncMess Apr 09 '22 at 13:21
  • Someone? Must be some solution, right? – CncMess Apr 23 '22 at 12:24

0 Answers0