diff --git a/mythtv/libs/libmythbase/logging.cpp b/mythtv/libs/libmythbase/logging.cpp
index d48a3a2..de06e4e 100644
|
a
|
b
|
typedef struct {
|
| 88 | 88 | |
| 89 | 89 | LogPropagateOpts logPropagateOpts; |
| 90 | 90 | QString logPropagateArgs; |
| | 91 | QStringList logPropagateArgList; |
| 91 | 92 | |
| 92 | 93 | #define TIMESTAMP_MAX 30 |
| 93 | 94 | #define MAX_STRING_LENGTH (LOGLINE_MAX+120) |
| … |
… |
void LogPrintLine( uint64_t mask, LogLevel_t level, const char *file, int line,
|
| 776 | 777 | /// spawned from this one. |
| 777 | 778 | void logPropagateCalc(void) |
| 778 | 779 | { |
| | 780 | logPropagateArgList.clear(); |
| | 781 | |
| 779 | 782 | QString mask = verboseString.trimmed(); |
| 780 | 783 | mask.replace(QRegExp(" "), ","); |
| 781 | 784 | mask.remove(QRegExp("^,")); |
| 782 | 785 | logPropagateArgs = " --verbose " + mask; |
| | 786 | logPropagateArgList << "--verbose" << mask; |
| 783 | 787 | |
| 784 | 788 | if (logPropagateOpts.propagate) |
| | 789 | { |
| 785 | 790 | logPropagateArgs += " --logpath " + logPropagateOpts.path; |
| | 791 | logPropagateArgList << "--logpath" << logPropagateOpts.path; |
| | 792 | } |
| 786 | 793 | |
| 787 | 794 | QString name = logLevelGetName(logLevel); |
| 788 | 795 | logPropagateArgs += " --loglevel " + name; |
| | 796 | logPropagateArgList << "--loglevel" << name; |
| 789 | 797 | |
| 790 | 798 | for (int i = 0; i < logPropagateOpts.quiet; i++) |
| | 799 | { |
| 791 | 800 | logPropagateArgs += " --quiet"; |
| | 801 | logPropagateArgList << "--quiet"; |
| | 802 | } |
| 792 | 803 | |
| 793 | 804 | if (!logPropagateOpts.dblog) |
| | 805 | { |
| 794 | 806 | logPropagateArgs += " --nodblog"; |
| | 807 | logPropagateArgList << "--nodblog"; |
| | 808 | } |
| 795 | 809 | |
| 796 | 810 | #ifndef _WIN32 |
| 797 | 811 | if (logPropagateOpts.facility >= 0) |
| … |
… |
void logPropagateCalc(void)
|
| 803 | 817 | syslogname->c_val != logPropagateOpts.facility); syslogname++); |
| 804 | 818 | |
| 805 | 819 | logPropagateArgs += QString(" --syslog %1").arg(syslogname->c_name); |
| | 820 | logPropagateArgList << "--syslog" << syslogname->c_name; |
| 806 | 821 | } |
| 807 | 822 | #endif |
| 808 | 823 | } |
diff --git a/mythtv/libs/libmythbase/mythlogging.h b/mythtv/libs/libmythbase/mythlogging.h
index 3473ea2..7d3a791 100644
|
a
|
b
|
|
| 3 | 3 | |
| 4 | 4 | #ifdef __cplusplus |
| 5 | 5 | #include <QString> |
| | 6 | #include <QStringList> |
| 6 | 7 | #endif |
| 7 | 8 | #include <stdint.h> |
| 8 | 9 | #include <errno.h> |
| … |
… |
extern MBASE_PUBLIC uint64_t verboseMask;
|
| 60 | 61 | #ifdef __cplusplus |
| 61 | 62 | } |
| 62 | 63 | |
| 63 | | extern MBASE_PUBLIC QString logPropagateArgs; |
| 64 | | extern MBASE_PUBLIC QString verboseString; |
| | 64 | extern MBASE_PUBLIC QStringList logPropagateArgList; |
| | 65 | extern MBASE_PUBLIC QString logPropagateArgs; |
| | 66 | extern MBASE_PUBLIC QString verboseString; |
| 65 | 67 | |
| 66 | 68 | MBASE_PUBLIC void logStart(QString logfile, int progress = 0, int quiet = 0, |
| 67 | 69 | int facility = 0, LogLevel_t level = LOG_INFO, |
diff --git a/mythtv/libs/libmythbase/mythsystem.cpp b/mythtv/libs/libmythbase/mythsystem.cpp
index 9ec5c45..52c8e0c 100644
|
a
|
b
|
void MythSystem::SetCommand(const QString &command,
|
| 105 | 105 | |
| 106 | 106 | ProcessFlags(flags); |
| 107 | 107 | |
| | 108 | // add logging arguments |
| | 109 | if (GetSetting("PropagateLogs")) |
| | 110 | { |
| | 111 | if (m_args.isEmpty()) |
| | 112 | { |
| | 113 | m_command += logPropagateArgs; |
| | 114 | if (!logPropagateQuiet()) |
| | 115 | m_command += " --quiet"; |
| | 116 | } |
| | 117 | else |
| | 118 | { |
| | 119 | m_args << logPropagateArgList; |
| | 120 | if (!logPropagateQuiet()) |
| | 121 | m_args << "--quiet"; |
| | 122 | } |
| | 123 | } |
| | 124 | |
| 108 | 125 | // check for execute rights |
| 109 | 126 | if (!GetSetting("UseShell") && access(command.toUtf8().constData(), X_OK)) |
| 110 | 127 | { |
| … |
… |
void MythSystem::ProcessFlags(uint flags)
|
| 320 | 337 | m_settings["AnonLog"] = true; |
| 321 | 338 | if( flags & kMSLowExitVal ) |
| 322 | 339 | m_settings["OnlyLowExitVal"] = true; |
| | 340 | if( flags & kMSPropagateLogs ) |
| | 341 | m_settings["PropagateLogs"] = true; |
| 323 | 342 | } |
| 324 | 343 | |
| 325 | 344 | QByteArray MythSystem::Read(int size) |
diff --git a/mythtv/libs/libmythbase/mythsystem.h b/mythtv/libs/libmythbase/mythsystem.h
index 31ddd1b..6762fd5 100644
|
a
|
b
|
typedef enum MythSystemMask {
|
| 26 | 26 | kMSLowExitVal = 0x00008000, ///< allow exit values 0-127 only |
| 27 | 27 | kMSDisableUDPListener = 0x00010000, ///< disable MythMessage UDP listener |
| 28 | 28 | /// for the duration of application. |
| | 29 | kMSPropagateLogs = 0x00020000, ///< add arguments for MythTV log |
| | 30 | /// propagation |
| 29 | 31 | } MythSystemFlag; |
| 30 | 32 | |
| 31 | 33 | #ifdef __cplusplus |
diff --git a/mythtv/libs/libmythtv/previewgenerator.cpp b/mythtv/libs/libmythtv/previewgenerator.cpp
index 20b4f2e..38e7c08 100644
|
a
|
b
|
bool PreviewGenerator::Run(void)
|
| 224 | 224 | else |
| 225 | 225 | { |
| 226 | 226 | // This is where we fork and run mythpreviewgen to actually make preview |
| 227 | | command += QString(" --size %1x%2") |
| 228 | | .arg(outSize.width()).arg(outSize.height()); |
| | 227 | QStringList cmdargs; |
| | 228 | |
| | 229 | cmdargs << "--size" |
| | 230 | << QString("%1x%2").arg(outSize.width()).arg(outSize.height()); |
| 229 | 231 | if (captureTime >= 0) |
| 230 | 232 | { |
| 231 | 233 | if (timeInSeconds) |
| 232 | | command += QString(" --seconds %1").arg(captureTime); |
| | 234 | cmdargs << "--seconds"; |
| 233 | 235 | else |
| 234 | | command += QString(" --frame %1").arg(captureTime); |
| | 236 | cmdargs << "--frame"; |
| | 237 | cmdargs << QString::number(captureTime); |
| 235 | 238 | } |
| 236 | | command += QString(" --chanid %1").arg(programInfo.GetChanID()); |
| 237 | | command += QString(" --starttime %1") |
| 238 | | .arg(programInfo.GetRecordingStartTime(MythDate::kFilename)); |
| | 239 | cmdargs << "--chanid" |
| | 240 | << QString::number(programInfo.GetChanID()) |
| | 241 | << "--starttime" |
| | 242 | << programInfo.GetRecordingStartTime(MythDate::kFilename); |
| 239 | 243 | |
| 240 | 244 | if (!outFileName.isEmpty()) |
| 241 | | command += QString(" --outfile \"%1\"").arg(outFileName); |
| 242 | | |
| 243 | | command += logPropagateArgs; |
| 244 | | if (!logPropagateQuiet()) |
| 245 | | command += " --quiet"; |
| | 245 | cmdargs << "--outfile" << outFileName; |
| 246 | 246 | |
| 247 | 247 | // Timeout in 30s |
| 248 | | uint ret = myth_system(command, kMSDontBlockInputDevs | |
| | 248 | MythSystem *ms = new MythSystem(command, cmdargs, |
| | 249 | kMSDontBlockInputDevs | |
| 249 | 250 | kMSDontDisableDrawing | |
| 250 | | kMSProcessEvents, 30); |
| | 251 | kMSProcessEvents | |
| | 252 | kMSNoRunShell | |
| | 253 | kMSAutoCleanup | |
| | 254 | kMSPropagateLogs); |
| | 255 | ms->SetNice(10); |
| | 256 | ms->SetIOPrio(7); |
| | 257 | |
| | 258 | ms->Run(30); |
| | 259 | uint ret = ms->Wait(); |
| | 260 | delete ms; |
| | 261 | |
| 251 | 262 | if (ret != GENERIC_EXIT_OK) |
| 252 | 263 | { |
| 253 | 264 | LOG(VB_GENERAL, LOG_ERR, LOC + |