Ticket #13633: 0003-Enable-output-from-the-grabber-to-be-logged.patch

File 0003-Enable-output-from-the-grabber-to-be-logged.patch, 1.6 KB (added by Gary Buhrmaster, 5 years ago)

Enable-output-from-the-grabber-to-be-logged

  • mythtv/programs/mythfilldatabase/filldata.cpp

    From c89eac9849214b7fa3d6f09dd3b71b2718de500d Mon Sep 17 00:00:00 2001
    From: Gary Buhrmaster <gary.buhrmaster@gmail.com>
    Date: Sun, 14 Jun 2020 00:01:39 +0000
    Subject: [PATCH 3/4] Enable output from the grabber to be logged
    
    Invoke the running of the grabber such that the output is
    actually captured and logged if the verbose xmltv option
    is specified (the header/trailer implies that at some time
    in the past the output was made available in the logs, but
    it has not been included for some time).
    ---
     mythtv/programs/mythfilldatabase/filldata.cpp | 13 ++++++++++++-
     1 file changed, 12 insertions(+), 1 deletion(-)
    
    diff --git a/mythtv/programs/mythfilldatabase/filldata.cpp b/mythtv/programs/mythfilldatabase/filldata.cpp
    index 1e42900832..e3c97bd801 100644
    a b bool FillData::GrabData(const Source& source, int offset) 
    178178    LOG(VB_XMLTV, LOG_INFO,
    179179            "----------------- Start of XMLTV output -----------------");
    180180
    181     uint systemcall_status = myth_system(command, kMSRunShell);
     181    MythSystemLegacy run_grabber(command, kMSRunShell | kMSStdErr);
     182
     183    run_grabber.Run();
     184    uint systemcall_status = run_grabber.Wait();
    182185    bool succeeded = (systemcall_status == GENERIC_EXIT_OK);
    183186
     187    QByteArray result = run_grabber.ReadAllErr();
     188    QTextStream ostream(result);
     189    while (!ostream.atEnd())
     190        {
     191            QString line = ostream.readLine().simplified();
     192            LOG(VB_XMLTV, LOG_INFO, line);
     193        }
     194
    184195    LOG(VB_XMLTV, LOG_INFO,
    185196            "------------------ End of XMLTV output ------------------");
    186197