Changeset f124159c7 in mythtv
- Timestamp:
- Aug 27, 2013, 4:16:29 AM (11 years ago)
- Branches:
- devel/2020-player, devel/ffmpeg-resync, fixes/0.27, fixes/0.28, fixes/29, fixes/30, fixes/31, github-templates, master
- Children:
- 3a73d8919
- Parents:
- a74baed2b
- Files:
-
- 7 edited
-
mythplugins/mytharchive/mytharchive/archiveutil.cpp (modified) (1 diff)
-
mythplugins/mytharchive/mytharchive/mythburn.cpp (modified) (1 diff)
-
mythtv/libs/libmythbase/logging.cpp (modified) (12 diffs)
-
mythtv/libs/libmythbase/logging.h (modified) (2 diffs)
-
mythtv/libs/libmythbase/mythcommandlineparser.cpp (modified) (4 diffs)
-
mythtv/libs/libmythbase/mythlogging.h (modified) (1 diff)
-
mythtv/libs/libmythbase/mythsystemlegacy.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mythplugins/mytharchive/mytharchive/archiveutil.cpp
ra74baed2b rf124159c7 251 251 if (logPropagateQuiet()) 252 252 command += " --quiet"; 253 if (logPropagateNoServer()) 254 command += " --nologserver"; 253 255 254 256 uint flags = kMSDontBlockInputDevs | kMSDontDisableDrawing; -
mythplugins/mytharchive/mytharchive/mythburn.cpp
ra74baed2b rf124159c7 1222 1222 if (logPropagateQuiet()) 1223 1223 commandline += " --quiet"; 1224 if (logPropagateNoServer()) 1225 commandline += " --nologserver"; 1224 1226 commandline += " > " + logDir + "/progress.log 2>&1 &"; 1225 1227 -
mythtv/libs/libmythbase/logging.cpp
ra74baed2b rf124159c7 82 82 bool dblog; 83 83 QString path; 84 bool noserver; 84 85 } LogPropagateOpts; 85 86 … … 251 252 /// set. 252 253 LoggerThread::LoggerThread(QString filename, bool progress, bool quiet, 253 QString table, int facility ) :254 QString table, int facility, bool noserver) : 254 255 MThread("Logger"), 255 256 m_waitNotEmpty(new QWaitCondition()), … … 260 261 m_tablename(table), m_facility(facility), m_pid(getpid()), m_epoch(0), 261 262 m_zmqContext(NULL), m_zmqSocket(NULL), m_initialTimer(NULL), 262 m_heartbeatTimer(NULL) 263 m_heartbeatTimer(NULL), m_noserver(noserver) 263 264 { 264 265 char *debug = getenv("VERBOSE_THREADS"); … … 272 273 273 274 #ifdef NOLOGSERVER 274 if (! logServerStart())275 if (!m_noserver && !logServerStart()) 275 276 { 276 277 LOG(VB_GENERAL, LOG_ERR, … … 288 289 289 290 #ifdef NOLOGSERVER 290 logServerStop(); 291 if (!m_noserver) 292 { 293 logServerStop(); 294 } 291 295 #endif 292 296 delete m_waitNotEmpty; … … 308 312 bool dieNow = false; 309 313 314 if (!m_noserver) 315 { 310 316 #ifndef NOLOGSERVER 311 try 312 { 313 if (m_locallogs) 314 { 315 logServerWait(); 316 m_zmqContext = logServerThread->getZMQContext(); 317 } 318 else 319 { 320 m_zmqContext = nzmqt::createDefaultContext(NULL); 321 m_zmqContext->start(); 322 } 323 324 if (!m_zmqContext) 325 { 317 try 318 { 319 if (m_locallogs) 320 { 321 logServerWait(); 322 m_zmqContext = logServerThread->getZMQContext(); 323 } 324 else 325 { 326 m_zmqContext = nzmqt::createDefaultContext(NULL); 327 m_zmqContext->start(); 328 } 329 330 if (!m_zmqContext) 331 { 332 m_aborted = true; 333 dieNow = true; 334 } 335 else 336 { 337 qRegisterMetaType<QList<QByteArray> >("QList<QByteArray>"); 338 339 m_zmqSocket = 340 m_zmqContext->createSocket(nzmqt::ZMQSocket::TYP_DEALER, this); 341 connect(m_zmqSocket, 342 SIGNAL(messageReceived(const QList<QByteArray>&)), 343 SLOT(messageReceived(const QList<QByteArray>&)), 344 Qt::QueuedConnection); 345 346 if (m_locallogs) 347 m_zmqSocket->connectTo("inproc://mylogs"); 348 else 349 m_zmqSocket->connectTo("tcp://127.0.0.1:35327"); 350 } 351 } 352 catch (nzmqt::ZMQException &e) 353 { 354 cerr << "Exception during logging socket setup: " << e.what() << endl; 326 355 m_aborted = true; 327 356 dieNow = true; 328 357 } 329 else 330 {331 qRegisterMetaType<QList<QByteArray> >("QList<QByteArray>");332 333 m_zmqSocket =334 m_ zmqContext->createSocket(nzmqt::ZMQSocket::TYP_DEALER, this);335 connect(m_zmqSocket,336 SIGNAL(messageReceived(const QList<QByteArray>&)), 337 SLOT(messageReceived(const QList<QByteArray>&)),338 Qt::QueuedConnection);339 340 if (m_locallogs)341 m_zmqSocket->connectTo("inproc://mylogs");358 359 if (!m_aborted) 360 { 361 if (!m_locallogs) 362 { 363 m_initialWaiting = true; 364 pingLogServer(); 365 366 // wait up to 150ms for mythlogserver to respond 367 m_initialTimer = new MythSignalingTimer(this, 368 SLOT(initialTimeout())); 369 m_initialTimer->start(150); 370 } 342 371 else 343 m_zmqSocket->connectTo("tcp://127.0.0.1:35327"); 344 } 345 } 346 catch (nzmqt::ZMQException &e) 347 { 348 cerr << "Exception during logging socket setup: " << e.what() << endl; 349 m_aborted = true; 350 dieNow = true; 351 } 352 353 if (!m_aborted) 354 { 355 if (!m_locallogs) 356 { 357 m_initialWaiting = true; 358 pingLogServer(); 359 360 // wait up to 150ms for mythlogserver to respond 361 m_initialTimer = new MythSignalingTimer(this, 362 SLOT(initialTimeout())); 363 m_initialTimer->start(150); 364 } 365 else 366 LOG(VB_GENERAL, LOG_INFO, "Added logging to mythlogserver locally"); 367 368 loggingGetTimeStamp(&m_epoch, NULL); 369 370 m_heartbeatTimer = new MythSignalingTimer(this, SLOT(checkHeartBeat())); 371 m_heartbeatTimer->start(1000); 372 } 373 #else 374 logServerWait(); 375 #endif 372 LOG(VB_GENERAL, LOG_INFO, "Added logging to mythlogserver locally"); 373 374 loggingGetTimeStamp(&m_epoch, NULL); 375 376 m_heartbeatTimer = new MythSignalingTimer(this, SLOT(checkHeartBeat())); 377 m_heartbeatTimer->start(1000); 378 } 379 #else 380 logServerWait(); 381 #endif 382 } 376 383 377 384 QMutexLocker qLock(&logQueueMutex); … … 597 604 free(threadName); 598 605 } 606 } 607 608 if (m_noserver) 609 { 610 return; 599 611 } 600 612 … … 853 865 } 854 866 #endif 867 868 if (logPropagateOpts.noserver) 869 { 870 logPropagateArgs += " --nologserver"; 871 logPropagateArgList << "--nologserver"; 872 } 855 873 } 856 874 … … 860 878 { 861 879 return logPropagateOpts.quiet; 880 } 881 882 /// \brief Check if we are propagating a "--nologserver" 883 /// \return true if --nologserver is being propagated 884 bool logPropagateNoServer(void) 885 { 886 return logPropagateOpts.noserver; 862 887 } 863 888 … … 875 900 /// processes. 876 901 void logStart(QString logfile, int progress, int quiet, int facility, 877 LogLevel_t level, bool dblog, bool propagate )902 LogLevel_t level, bool dblog, bool propagate, bool noserver) 878 903 { 879 904 if (logThread && logThread->isRunning()) … … 888 913 logPropagateOpts.facility = facility; 889 914 logPropagateOpts.dblog = dblog; 915 logPropagateOpts.noserver = noserver; 890 916 891 917 if (propagate) … … 901 927 902 928 if (!logThread) 903 logThread = new LoggerThread(logfile, progress, quiet, table, facility );929 logThread = new LoggerThread(logfile, progress, quiet, table, facility, noserver); 904 930 905 931 logThread->start(); -
mythtv/libs/libmythbase/logging.h
ra74baed2b rf124159c7 173 173 public: 174 174 LoggerThread(QString filename, bool progress, bool quiet, QString table, 175 int facility );175 int facility, bool noserver); 176 176 ~LoggerThread(); 177 177 void run(void); … … 209 209 MythSignalingTimer *m_heartbeatTimer; ///< Timer for 1s heartbeats 210 210 211 bool m_noserver; 212 211 213 protected: 212 214 bool logConsole(LoggingItem *item); -
mythtv/libs/libmythbase/mythcommandlineparser.cpp
ra74baed2b rf124159c7 2376 2376 2377 2377 /** \brief Canned argument definition for all logging options, including 2378 * --verbose, --logpath, --quiet, --loglevel, --syslog 2379 * and -- enable-dblog2378 * --verbose, --logpath, --quiet, --loglevel, --syslog, --enable-dblog 2379 * and --nologserver 2380 2380 */ 2381 2381 void MythCommandLineParser::addLogging( … … 2433 2433 "existing system logging daemon, or --logpath to specify a " 2434 2434 "dirctory for MythTV to write its logs to.", "0.25"); 2435 add("--nologserver", "nologserver", false, "Disable all logging but console.", "") 2436 ->SetGroup("Logging"); 2435 2437 } 2436 2438 … … 2582 2584 int facility = GetSyslogFacility(); 2583 2585 bool dblog = toBool("enabledblog"); 2586 bool noserver = toBool("nologserver"); 2584 2587 LogLevel_t level = GetLogLevel(); 2585 2588 if (level == LOG_UNKNOWN) … … 2601 2604 quiet = max(quiet, 1); 2602 2605 2603 logStart(logfile, progress, quiet, facility, level, dblog, propagate );2606 logStart(logfile, progress, quiet, facility, level, dblog, propagate, noserver); 2604 2607 2605 2608 return GENERIC_EXIT_OK; -
mythtv/libs/libmythbase/mythlogging.h
ra74baed2b rf124159c7 68 68 MBASE_PUBLIC void logStart(QString logfile, int progress = 0, int quiet = 0, 69 69 int facility = 0, LogLevel_t level = LOG_INFO, 70 bool dblog = true, bool propagate = false); 70 bool dblog = true, bool propagate = false, 71 bool noserver = false); 71 72 MBASE_PUBLIC void logStop(void); 72 73 MBASE_PUBLIC void logPropagateCalc(void); 73 74 MBASE_PUBLIC bool logPropagateQuiet(void); 75 MBASE_PUBLIC bool logPropagateNoServer(void); 74 76 75 77 MBASE_PUBLIC int syslogGetFacility(QString facility); -
mythtv/libs/libmythbase/mythsystemlegacy.cpp
ra74baed2b rf124159c7 145 145 if (logPropagateQuiet()) 146 146 m_command += " --quiet"; 147 if (logPropagateNoServer()) 148 m_command += " --nologserver"; 147 149 } 148 150 else … … 151 153 if (logPropagateQuiet()) 152 154 m_args << "--quiet"; 155 if (logPropagateNoServer()) 156 m_args << "--nologserver"; 153 157 } 154 158 }
Note: See TracChangeset
for help on using the changeset viewer.
