|
MythTV
0.27pre
|
Go to the source code of this file.
Classes | |
| struct | LogPropagateOpts |
Functions | |
| void | verboseAdd (uint64_t mask, QString name, bool additive, QString helptext) |
| Add a verbose level to the verboseMap. | |
| void | loglevelAdd (int value, QString name, char shortname) |
| Add a log level to the logLevelMap. | |
| void | verboseInit (void) |
| Initialize the logging levels and verbose levels. | |
| void | verboseHelp (void) |
| Outputs the Verbose levels and their descriptions (for –verbose help) | |
| void | loggingGetTimeStamp (qlonglong *epoch, uint *usec) |
| void | LogPrintLine (uint64_t mask, LogLevel_t level, const char *file, int line, const char *function, int fromQString, const char *format,...) |
| Format and send a log message into the queue. | |
| void | logPropagateCalc (void) |
| Generate the logPropagateArgs global with the latest logging level, mask, etc to propagate to all of the mythtv programs spawned from this one. | |
| bool | logPropagateQuiet (void) |
| Check if we are propagating a "–quiet". | |
| void | logStart (QString logfile, int progress, int quiet, int facility, LogLevel_t level, bool dblog, bool propagate) |
| Entry point to start logging for the application. | |
| void | logStop (void) |
| Entry point for stopping logging for an application. | |
| void | loggingRegisterThread (const QString &name) |
| Register the current thread with the given name. | |
| void | loggingDeregisterThread (void) |
| Deregister the current thread's name. | |
| int | syslogGetFacility (QString facility) |
| Map a syslog facility name back to the enumerated value. | |
| LogLevel_t | logLevelGet (QString level) |
| Map a log level name back to the enumerated value. | |
| QString | logLevelGetName (LogLevel_t level) |
| Map a log level enumerated value back to the name. | |
| int | verboseArgParse (QString arg) |
| Parse the –verbose commandline argument and set the verbose level. | |
| QString | logStrerror (int errnum) |
| Verbose helper function for ENO macro. | |
Variables | |
| static QMutex | logQueueMutex |
| static QQueue< LoggingItem * > | logQueue |
| static QRegExp | logRegExp = QRegExp("[%]{1,2}") |
| static LoggerThread * | logThread = NULL |
| static QMutex | logThreadMutex |
| static QHash< uint64_t, char * > | logThreadHash |
| static QMutex | logThreadTidMutex |
| static QHash< uint64_t, int64_t > | logThreadTidHash |
| static bool | logThreadFinished = false |
| static bool | debugRegistration = false |
| LogPropagateOpts | logPropagateOpts |
| QString | logPropagateArgs |
| QStringList | logPropagateArgList |
| LogLevel_t | logLevel = (LogLevel_t)LOG_INFO |
| bool | verboseInitialized = false |
| VerboseMap | verboseMap |
| QMutex | verboseMapMutex |
| LoglevelMap | loglevelMap |
| QMutex | loglevelMapMutex |
| const uint64_t | verboseDefaultInt = VB_GENERAL |
| const char * | verboseDefaultStr = " general" |
| uint64_t | verboseMask = verboseDefaultInt |
| QString | verboseString = QString(verboseDefaultStr) |
| uint64_t | userDefaultValueInt = verboseDefaultInt |
| QString | userDefaultValueStr = QString(verboseDefaultStr) |
| bool | haveUserDefaultValues = false |
Add a verbose level to the verboseMap.
Done at initialization.
| mask | verbose mask (VB_*) |
| name | name of the verbosity level |
| additive | true if this is to be ORed with other masks. false if is will clear the other bits. |
| helptext | Descriptive text for –verbose help output |
Definition at line 998 of file logging.cpp.
Add a log level to the logLevelMap.
Done at initialization.
| value | log level enumerated value (LOG_*) - matches syslog levels |
| name | name of the log level |
| shortname | one-letter short name for output into logs |
Definition at line 1020 of file logging.cpp.
Initialize the logging levels and verbose levels.
Definition at line 1036 of file logging.cpp.
Referenced by logLevelGet(), logLevelGetName(), and verboseArgParse().
Outputs the Verbose levels and their descriptions (for –verbose help)
Definition at line 1061 of file logging.cpp.
Referenced by verboseArgParse().
Definition at line 120 of file logging.cpp.
Referenced by LoggerThread::checkHeartBeat(), LogServerThread::checkHeartBeats(), LogForwardThread::forwardMessage(), LoggingItem::LoggingItem(), LoggerThread::messageReceived(), and LoggerThread::run().
| void LogPrintLine | ( | uint64_t | mask, |
| LogLevel_t | level, | ||
| const char * | file, | ||
| int | line, | ||
| const char * | function, | ||
| int | fromQString, | ||
| const char * | format, | ||
| ... | |||
| ) |
Format and send a log message into the queue.
This is called from the LOG() macro. The intention is minimal blocking of the caller.
| mask | Verbosity mask of the message (VB_*) |
| level | Log level of this message (LOG_* - matching syslog levels) |
| file | Filename of source code logging the message |
| line | Line number within the source of log message source |
| function | Function name of the log message source |
| fromQString | true if this message originated from QString |
| format | printf format string (when not from QString), log message (when from QString) |
| ... | printf arguments (when not from QString) |
Definition at line 722 of file logging.cpp.
Generate the logPropagateArgs global with the latest logging level, mask, etc to propagate to all of the mythtv programs spawned from this one.
Definition at line 778 of file logging.cpp.
Referenced by MainServer::HandleSetLogLevel(), MainServer::HandleSetVerbose(), and logStart().
Check if we are propagating a "–quiet".
Definition at line 827 of file logging.cpp.
Referenced by BurnMenu::doBurn(), getFileDetails(), and MythSystem::SetCommand().
| void logStart | ( | QString | logfile, |
| int | progress, | ||
| int | quiet, | ||
| int | facility, | ||
| LogLevel_t | level, | ||
| bool | dblog, | ||
| bool | propagate | ||
| ) |
Entry point to start logging for the application.
This will start up all of the threads needed.
| logfile | Filename of the logfile to create. Empty if no file. |
| progress | non-zero if progress output will be sent to the console. This squelches all messages less important than LOG_ERR on the console |
| quiet | quiet level requested (squelches all console output) |
| facility | Syslog facility to use. -1 to disable syslog output |
| level | Minimum logging level to put into the logs |
| dblog | true if database logging is requested |
| propagate | true if the logfile path needs to be propagated to child processes. |
Definition at line 844 of file logging.cpp.
Referenced by MythCommandLineParser::ConfigureLogging().
Entry point for stopping logging for an application.
Definition at line 877 of file logging.cpp.
Referenced by MythContext::~MythContext(), and MythCoreContextPrivate::~MythCoreContextPrivate().
| void loggingRegisterThread | ( | const QString & | name | ) |
Register the current thread with the given name.
This is triggered by the RunProlog() call in each thread.
| name | the name of the thread being registered. This is used for indicating the thread each log message is coming from. |
Definition at line 892 of file logging.cpp.
Referenced by MPoolThread::run(), and MThread::ThreadSetup().
Deregister the current thread's name.
This is triggered by the RunEpilog() call in each thread.
Definition at line 911 of file logging.cpp.
Referenced by MPoolThread::run(), MThread::ThreadCleanup(), and MythCoreContextPrivate::~MythCoreContextPrivate().
| int syslogGetFacility | ( | QString | facility | ) |
Map a syslog facility name back to the enumerated value.
| facility | QString containing the facility name |
Definition at line 929 of file logging.cpp.
Referenced by MythCommandLineParser::GetSyslogFacility().
| LogLevel_t logLevelGet | ( | QString | level | ) |
Map a log level name back to the enumerated value.
| level | QString containing the log level name |
Definition at line 951 of file logging.cpp.
Referenced by MythCommandLineParser::GetLogLevel(), Myth::GetLogs(), and MainServer::HandleSetLogLevel().
| QString logLevelGetName | ( | LogLevel_t | level | ) |
Map a log level enumerated value back to the name.
| level | Enumerated value of the log level |
Definition at line 975 of file logging.cpp.
Referenced by MythCommandLineParser::addLogging(), Myth::GetLogs(), MainServer::HandleSetLogLevel(), logPropagateCalc(), and logStart().
| int verboseArgParse | ( | QString | arg | ) |
Parse the –verbose commandline argument and set the verbose level.
| arg | the commandline argument following "–verbose" |
Definition at line 1098 of file logging.cpp.
Referenced by MythCommandLineParser::ConfigureLogging(), MainServer::HandleSetVerbose(), and NetworkControl::processSet().
| QString logStrerror | ( | int | errnum | ) |
Verbose helper function for ENO macro.
| errnum | system errno value |
Definition at line 1208 of file logging.cpp.
|
static |
Definition at line 67 of file logging.cpp.
Referenced by LoggerThread::flush(), loggingDeregisterThread(), loggingRegisterThread(), LogPrintLine(), LoggerThread::run(), and LoggerThread::stop().
|
static |
Definition at line 68 of file logging.cpp.
Referenced by LoggerThread::flush(), loggingDeregisterThread(), loggingRegisterThread(), LogPrintLine(), and LoggerThread::run().
|
static |
Definition at line 69 of file logging.cpp.
Referenced by LogPrintLine().
|
static |
Definition at line 71 of file logging.cpp.
Referenced by LogPrintLine(), logStart(), and logStop().
|
static |
Definition at line 72 of file logging.cpp.
Referenced by LoggingItem::getThreadName(), and LoggerThread::handleItem().
|
static |
Definition at line 73 of file logging.cpp.
Referenced by LoggingItem::getThreadName(), and LoggerThread::handleItem().
|
static |
Definition at line 75 of file logging.cpp.
Referenced by LoggingItem::getThreadTid(), LoggerThread::handleItem(), and LoggingItem::setThreadTid().
|
static |
Definition at line 76 of file logging.cpp.
Referenced by LoggingItem::getThreadTid(), LoggerThread::handleItem(), and LoggingItem::setThreadTid().
Definition at line 78 of file logging.cpp.
Referenced by LoggerThread::handleItem(), loggingDeregisterThread(), loggingRegisterThread(), LogPrintLine(), and LoggerThread::run().
Definition at line 79 of file logging.cpp.
Referenced by LoggerThread::handleItem(), and LoggerThread::LoggerThread().
| LogPropagateOpts logPropagateOpts |
Definition at line 89 of file logging.cpp.
Referenced by logPropagateCalc(), logPropagateQuiet(), and logStart().
| QString logPropagateArgs |
Definition at line 90 of file logging.cpp.
Referenced by WelcomeDialog::checkAutoStart(), BurnMenu::doBurn(), JobQueue::DoFlagCommercialsThread(), JobQueue::DoMetadataLookupThread(), JobQueue::DoTranscodeThread(), getFileDetails(), JobQueue::GetJobCommand(), WelcomeDialog::keyPressEvent(), LoggerThread::launchLogServer(), ThumbGenerator::loadFile(), WelcomeDialog::lockShutdown(), logPropagateCalc(), HTTPLiveStreamThread::run(), HouseKeeper::RunMFD(), WelcomeDialog::runMythFillDatabase(), MythSystem::SetCommand(), WelcomeDialog::showMenu(), WelcomeDialog::shutdownNow(), LCD::startLCDServer(), WelcomeDialog::unlockShutdown(), SourceUtil::UpdateChannelsFromListings(), HouseKeeper::UpdateRecordedArtwork(), and WelcomeDialog::updateStatusMessage().
| QStringList logPropagateArgList |
Definition at line 91 of file logging.cpp.
Referenced by logPropagateCalc(), and MythSystem::SetCommand().
| LogLevel_t logLevel = (LogLevel_t)LOG_INFO |
Definition at line 96 of file logging.cpp.
Referenced by handle_command(), MainServer::HandleSetLogLevel(), logPropagateCalc(), logStart(), main(), MHSetLogging(), PrintOutput::Output(), pid_counter(), pid_filter(), pid_printer(), MythSocket::ReadStringListReal(), and MythSocket::WriteStringListReal().
Definition at line 98 of file logging.cpp.
Referenced by logLevelGet(), logLevelGetName(), verboseArgParse(), and verboseInit().
| VerboseMap verboseMap |
Definition at line 99 of file logging.cpp.
Referenced by verboseAdd(), verboseArgParse(), verboseHelp(), and verboseInit().
| QMutex verboseMapMutex |
Definition at line 100 of file logging.cpp.
Referenced by verboseArgParse(), and verboseInit().
| LoglevelMap loglevelMap |
Definition at line 102 of file logging.cpp.
Referenced by LoggerThread::logConsole(), loglevelAdd(), logLevelGet(), logLevelGetName(), FileLogger::logmsg(), SyslogLogger::logmsg(), and verboseInit().
| QMutex loglevelMapMutex |
Definition at line 103 of file logging.cpp.
Referenced by LoggerThread::logConsole(), logLevelGet(), logLevelGetName(), FileLogger::logmsg(), SyslogLogger::logmsg(), and verboseInit().
| const uint64_t verboseDefaultInt = VB_GENERAL |
Definition at line 105 of file logging.cpp.
Referenced by verboseArgParse().
| const char* verboseDefaultStr = " general" |
Definition at line 106 of file logging.cpp.
Referenced by verboseArgParse().
| uint64_t verboseMask = verboseDefaultInt |
Definition at line 108 of file logging.cpp.
Referenced by MythCommandLineParser::ConfigureLogging(), JobQueue::GetJobCommand(), handle_command(), main(), MythSystemEventHandler::SubstituteMatches(), and verboseArgParse().
| QString verboseString = QString(verboseDefaultStr) |
Definition at line 109 of file logging.cpp.
Referenced by MythCommandLineParser::ConfigureLogging(), MainServer::HandleSetVerbose(), logPropagateCalc(), main(), NetworkControl::processQuery(), NetworkControl::processSet(), and verboseArgParse().
| uint64_t userDefaultValueInt = verboseDefaultInt |
Definition at line 111 of file logging.cpp.
Referenced by verboseArgParse().
| QString userDefaultValueStr = QString(verboseDefaultStr) |
Definition at line 112 of file logging.cpp.
Referenced by verboseArgParse(), and verboseHelp().
Definition at line 113 of file logging.cpp.
Referenced by verboseArgParse().
1.8.1.2