tvgrabbers / tvgrabpyAPI

An xmltv-API for extracting and merging tv programme information from several sources
https://github.com/tvgrabbers/tvgrabpyAPI/releases/latest
GNU General Public License v3.0
27 stars 8 forks source link

tv_grab_nl3.py with --quiet still writes to stderr #45

Closed janpascal closed 4 years ago

janpascal commented 4 years ago

I'm running tv_grab_nl3.py in a cron job. stdout is piped via a socket to tvheadend, but every time the job runs I get an email from cron with text like

Loaded the English texts file Using config file: /home/janpascal/.xmltv/tv_grab_nl3_py.conf Downloading tv_grab_API.json... Downloading tv_grab_nl.json...

It looks like this is the stderr output from tv_grab_nl3.py, which it outputs even though the --quiet flag is used. I think this output should be suppressed with the --quiet flag.

hikavdh commented 4 years ago

quiet suppresses output on stdout not on stderr

hikavdh commented 4 years ago

So if you want to pipe the result instead of using the output file, you must not use quiet as then you get nothing to pipe!

janpascal commented 4 years ago

I'm sorry, but I'm quite sure as this has worked for years. I've just tried again just to be absolutely sure:

venv/bin/tv_grab_nl3.py --quiet > stdout.txt 2>stderr.txt &

gives the status messages on stderr as above, and the xml data on stdout.

The function Logging.writelog (in tv_grab_IO.py) checks the quiet flag and should prevent writing to stderr when it is set. Except that it doesn't for these few lines. I'll try to check why :).

hikavdh commented 4 years ago

You're right. It's been a long time since I looked at that part, while in between I worked other code. My guess is that there is a problem with your log-file as then message meant for the log-file are send to stderr. In that stderr output you then should see something about the log-file.