Go to the source code of this file.
Classes | |
| struct | LogPropagateOpts |
| struct | VerboseDef |
| struct | LoglevelDef |
| class | LoggingItem |
Typedefs | |
| typedef QMap< QString, VerboseDef * > | VerboseMap |
| typedef QMap< int, LoglevelDef * > | LoglevelMap |
Enumerations | |
| enum | LoggingType { kMessage = 0x01, kRegistering = 0x02, kDeregistering = 0x04, kFlush = 0x08, kStandardIO = 0x10 } |
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 | LogTimeStamp (struct tm *tm, uint32_t *usec) |
| Fill in the time structure from the current time to make a timestamp for the log message. | |
| char * | getThreadName (LoggingItem *item) |
| Get the name of the thread that produced the LoggingItem. | |
| int64_t | getThreadTid (LoggingItem *item) |
| Get the thread ID of the thread that produced the LoggingItem. | |
| void | setThreadTid (LoggingItem *item) |
| Set the thread ID of the thread that produced the LoggingItem. | |
| static LoggingItem * | createItem (const char *_file, const char *_function, int _line, LogLevel_t _level, int _type) |
| Create a new LoggingItem. | |
| static void | deleteItem (LoggingItem *item) |
| Delete the LoggingItem once its reference count has run down. | |
| void | logSighup (int signum, siginfo_t *info, void *secret) |
| SIGHUP handler - reopen all open logfiles for logrollers. | |
| 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 | |
| QMutex | loggerListMutex |
| QList< LoggerBase * > | loggerList |
| QMutex | logQueueMutex |
| QQueue< LoggingItem * > | logQueue |
| QRegExp | logRegExp = QRegExp("[%]{1,2}") |
| QMutex | logThreadMutex |
| QHash< uint64_t, char * > | logThreadHash |
| QMutex | logThreadTidMutex |
| QHash< uint64_t, int64_t > | logThreadTidHash |
| LoggerThread * | logThread = NULL |
| bool | logThreadFinished = false |
| bool | debugRegistration = false |
| LogPropagateOpts | logPropagateOpts |
| QString | logPropagateArgs |
| 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 |
| static QList< LoggingItem * > | item_recycler |
| static QAtomicInt | item_count |
| static QAtomicInt | malloc_count |
| static int | max_count = 0 |
| static QTime | memory_time |
| typedef QMap<QString, VerboseDef *> VerboseMap |
Definition at line 94 of file logging.cpp.
| typedef QMap<int, LoglevelDef *> LoglevelMap |
Definition at line 101 of file logging.cpp.
| enum LoggingType |
Definition at line 136 of file logging.cpp.
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 1360 of file logging.cpp.
| void loglevelAdd | ( | int | value, | |
| QString | name, | |||
| char | shortname | |||
| ) |
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 1382 of file logging.cpp.
| void verboseInit | ( | void | ) |
Initialize the logging levels and verbose levels.
Definition at line 1398 of file logging.cpp.
Referenced by logLevelGet(), logLevelGetName(), and verboseArgParse().
| void verboseHelp | ( | void | ) |
Outputs the Verbose levels and their descriptions (for --verbose help).
Definition at line 1423 of file logging.cpp.
Referenced by verboseArgParse().
| void LogTimeStamp | ( | struct tm * | tm, | |
| uint32_t * | usec | |||
| ) |
Fill in the time structure from the current time to make a timestamp for the log message.
This is run as part of the LOG() call.
| tm | pointer to the time structure to fill in | |
| usec | pointer to a 32bit unsigned int to return the number of us |
Definition at line 1004 of file logging.cpp.
Referenced by LoggingItem::LoggingItem().
| char * getThreadName | ( | LoggingItem * | item | ) |
Get the name of the thread that produced the LoggingItem.
| item | the LoggingItem in question |
Definition at line 699 of file logging.cpp.
Referenced by SyslogLogger::logmsg(), FileLogger::logmsg(), and DatabaseLogger::logqmsg().
| int64_t getThreadTid | ( | LoggingItem * | item | ) |
Get the thread ID of the thread that produced the LoggingItem.
| item | the LoggingItem in question |
Definition at line 729 of file logging.cpp.
Referenced by LoggerThread::handleItem(), FileLogger::logmsg(), and DatabaseLogger::logqmsg().
| void setThreadTid | ( | LoggingItem * | item | ) |
Set the thread ID of the thread that produced the LoggingItem.
This code is actually run in the thread in question as part of the call to LOG()
| item | the LoggingItem in question In different platforms, the actual value returned here will vary. The intention is to get a thread ID that will map well to what is shown in gdb. |
Definition at line 750 of file logging.cpp.
Referenced by LoggingItem::LoggingItem().
| static LoggingItem * createItem | ( | const char * | _file, | |
| const char * | _function, | |||
| int | _line, | |||
| LogLevel_t | _level, | |||
| int | _type | |||
| ) | [static] |
Create a new LoggingItem.
| _file | filename of the source file where the log message is from | |
| _function | source function where the log message is from | |
| _line | line number in the source where the log message is from | |
| _level | logging level of the message (LogLevel_t) | |
| _type | type of logging message |
Definition at line 956 of file logging.cpp.
Referenced by loggingDeregisterThread(), loggingRegisterThread(), and LogPrintLine().
| static void deleteItem | ( | LoggingItem * | item | ) | [static] |
Delete the LoggingItem once its reference count has run down.
| item | LoggingItem to delete. |
Definition at line 986 of file logging.cpp.
Referenced by FileLogger::logmsg(), LogPrintLine(), DatabaseLogger::logqmsg(), LoggerThread::run(), DBLoggerThread::run(), and DBLoggerThread::~DBLoggerThread().
| void logSighup | ( | int | signum, | |
| siginfo_t * | info, | |||
| void * | secret | |||
| ) |
SIGHUP handler - reopen all open logfiles for logrollers.
Definition at line 1090 of file logging.cpp.
Referenced by logStart().
| 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 1038 of file logging.cpp.
| 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.
Definition at line 1108 of file logging.cpp.
Referenced by MainServer::HandleSetLogLevel(), MainServer::HandleSetVerbose(), and logStart().
| bool logPropagateQuiet | ( | void | ) |
Check if we are propagating a "--quiet".
Definition at line 1143 of file logging.cpp.
Referenced by BurnMenu::doBurn(), ImportNative::finishedPressed(), getFileDetails(), PreviewGenerator::Run(), and ExportNative::runScript().
| 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 1160 of file logging.cpp.
Referenced by MythCommandLineParser::ConfigureLogging().
| void logStop | ( | void | ) |
Entry point for stopping logging for an application.
Definition at line 1229 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 1257 of file logging.cpp.
Referenced by MPoolThread::run(), and MThread::ThreadSetup().
| void loggingDeregisterThread | ( | void | ) |
Deregister the current thread's name.
This is triggered by the RunEpilog() call in each thread.
Definition at line 1275 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 1291 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 1313 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 1337 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 1460 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 1570 of file logging.cpp.
| QMutex loggerListMutex |
Definition at line 55 of file logging.cpp.
Referenced by LoggerThread::handleItem(), LoggerBase::LoggerBase(), logSighup(), LoggerBase::~LoggerBase(), and LoggerThread::~LoggerThread().
| QList<LoggerBase *> loggerList |
Definition at line 56 of file logging.cpp.
Referenced by LoggerThread::handleItem(), LoggerBase::LoggerBase(), logSighup(), logStop(), LoggerBase::~LoggerBase(), and LoggerThread::~LoggerThread().
| QMutex logQueueMutex |
Definition at line 58 of file logging.cpp.
Referenced by LoggerThread::flush(), loggingDeregisterThread(), loggingRegisterThread(), LogPrintLine(), logStart(), LoggerThread::run(), and LoggerThread::stop().
| QQueue<LoggingItem *> logQueue |
Definition at line 59 of file logging.cpp.
Referenced by LoggerThread::flush(), loggingDeregisterThread(), loggingRegisterThread(), LogPrintLine(), and LoggerThread::run().
| QRegExp logRegExp = QRegExp("[%]{1,2}") |
Definition at line 60 of file logging.cpp.
Referenced by LogPrintLine().
| QMutex logThreadMutex |
Definition at line 62 of file logging.cpp.
Referenced by getThreadName(), and LoggerThread::handleItem().
| QHash<uint64_t, char *> logThreadHash |
Definition at line 63 of file logging.cpp.
Referenced by getThreadName(), and LoggerThread::handleItem().
| QMutex logThreadTidMutex |
Definition at line 65 of file logging.cpp.
Referenced by getThreadTid(), LoggerThread::handleItem(), and setThreadTid().
| QHash<uint64_t, int64_t> logThreadTidHash |
Definition at line 66 of file logging.cpp.
Referenced by getThreadTid(), LoggerThread::handleItem(), and setThreadTid().
| LoggerThread* logThread = NULL |
Definition at line 68 of file logging.cpp.
| bool logThreadFinished = false |
Definition at line 69 of file logging.cpp.
Referenced by loggingDeregisterThread(), loggingRegisterThread(), LogPrintLine(), and LoggerThread::run().
| bool debugRegistration = false |
Definition at line 70 of file logging.cpp.
Referenced by LoggerThread::handleItem(), and LoggerThread::LoggerThread().
Definition at line 80 of file logging.cpp.
| QString logPropagateArgs |
Definition at line 81 of file logging.cpp.
Referenced by WelcomeDialog::checkAutoStart(), BurnMenu::doBurn(), JobQueue::DoFlagCommercialsThread(), JobQueue::DoMetadataLookupThread(), JobQueue::DoTranscodeThread(), ImportNative::finishedPressed(), getFileDetails(), JobQueue::GetJobCommand(), WelcomeDialog::keyPressEvent(), ThumbGenerator::loadFile(), WelcomeDialog::lockShutdown(), logPropagateCalc(), PreviewGenerator::Run(), HTTPLiveStreamThread::run(), HouseKeeper::RunMFD(), WelcomeDialog::runMythFillDatabase(), ExportNative::runScript(), WelcomeDialog::showMenu(), WelcomeDialog::shutdownNow(), LCD::startLCDServer(), WelcomeDialog::unlockShutdown(), SourceUtil::UpdateChannelsFromListings(), HouseKeeper::UpdateRecordedArtwork(), and WelcomeDialog::updateStatusMessage().
| LogLevel_t logLevel = (LogLevel_t)LOG_INFO |
Definition at line 86 of file logging.cpp.
Referenced by handle_command(), MainServer::HandleSetLogLevel(), logPropagateCalc(), logStart(), main(), PrintOutput::Output(), pid_counter(), pid_filter(), pid_printer(), MythSocket::readStringList(), and MythSocket::writeStringList().
| bool verboseInitialized = false |
Definition at line 103 of file logging.cpp.
Referenced by logLevelGet(), logLevelGetName(), verboseArgParse(), and verboseInit().
Definition at line 104 of file logging.cpp.
Referenced by verboseAdd(), verboseArgParse(), verboseHelp(), and verboseInit().
| QMutex verboseMapMutex |
Definition at line 105 of file logging.cpp.
Referenced by verboseArgParse(), and verboseInit().
Definition at line 107 of file logging.cpp.
Referenced by loglevelAdd(), logLevelGet(), logLevelGetName(), SyslogLogger::logmsg(), FileLogger::logmsg(), and verboseInit().
| QMutex loglevelMapMutex |
Definition at line 108 of file logging.cpp.
Referenced by logLevelGet(), logLevelGetName(), SyslogLogger::logmsg(), FileLogger::logmsg(), and verboseInit().
| const uint64_t verboseDefaultInt = VB_GENERAL |
Definition at line 110 of file logging.cpp.
Referenced by verboseArgParse().
| const char* verboseDefaultStr = " general" |
Definition at line 111 of file logging.cpp.
Referenced by verboseArgParse().
Definition at line 113 of file logging.cpp.
Referenced by MythCommandLineParser::ConfigureLogging(), JobQueue::GetJobCommand(), handle_command(), main(), MythSystemEventHandler::SubstituteMatches(), and verboseArgParse().
| QString verboseString = QString(verboseDefaultStr) |
Definition at line 114 of file logging.cpp.
Referenced by MythCommandLineParser::ConfigureLogging(), MainServer::HandleSetVerbose(), logPropagateCalc(), main(), NetworkControl::processQuery(), NetworkControl::processSet(), verboseArgParse(), and verboseHelp().
Definition at line 116 of file logging.cpp.
Referenced by verboseArgParse().
| QString userDefaultValueStr = QString(verboseDefaultStr) |
Definition at line 117 of file logging.cpp.
Referenced by verboseArgParse().
| bool haveUserDefaultValues = false |
Definition at line 118 of file logging.cpp.
Referenced by verboseArgParse().
QList<LoggingItem*> item_recycler [static] |
Definition at line 939 of file logging.cpp.
QAtomicInt item_count [static] |
Definition at line 940 of file logging.cpp.
Referenced by createItem(), and deleteItem().
QAtomicInt malloc_count [static] |
Definition at line 941 of file logging.cpp.
Referenced by createItem().
int max_count = 0 [static] |
Definition at line 945 of file logging.cpp.
Referenced by createItem(), and CardUtil::ProbeVideoDevices().
QTime memory_time [static] |
Definition at line 946 of file logging.cpp.
Referenced by createItem().
1.6.3