MythTV
master
|
#include <QString>
#include <QStringList>
#include <cstdint>
#include <cerrno>
#include "mythbaseexp.h"
#include "verbosedefs.h"
Go to the source code of this file.
Macros | |
#define | VERBOSE_LEVEL_NONE (verboseMask == 0) |
#define | VERBOSE_LEVEL_CHECK(_MASK_, _LEVEL_) |
#define | VERBOSE please_use_LOG_instead_of_VERBOSE |
#define | LOG(_MASK_, _LEVEL_, _STRING_) |
#define | ENO (QString("\n\t\t\teno: ") + logStrerror(errno)) |
This can be appended to the LOG args with "+". More... | |
#define | ENO_STR ENO.toLocal8Bit().constData() |
Functions | |
MBASE_PUBLIC 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. More... | |
MBASE_PUBLIC void | logStart (QString logfile, int progress=0, int quiet=0, int facility=0, LogLevel_t level=LOG_INFO, bool dblog=true, bool propagate=false) |
Entry point to start logging for the application. More... | |
MBASE_PUBLIC void | logStop (void) |
Entry point for stopping logging for an application. More... | |
MBASE_PUBLIC 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. More... | |
MBASE_PUBLIC bool | logPropagateQuiet (void) |
Check if we are propagating a "--quiet". More... | |
MBASE_PUBLIC int | syslogGetFacility (QString facility) |
Map a syslog facility name back to the enumerated value. More... | |
MBASE_PUBLIC LogLevel_t | logLevelGet (QString level) |
Map a log level name back to the enumerated value. More... | |
MBASE_PUBLIC QString | logLevelGetName (LogLevel_t level) |
Map a log level enumerated value back to the name. More... | |
MBASE_PUBLIC int | verboseArgParse (QString arg) |
Parse the –verbose commandline argument and set the verbose level. More... | |
MBASE_PUBLIC QString | logStrerror (int errnum) |
Verbose helper function for ENO macro. More... | |
Variables | |
MBASE_PUBLIC LogLevel_t | logLevel |
MBASE_PUBLIC uint64_t | verboseMask |
MBASE_PUBLIC ComponentLogLevelMap | componentLogLevel |
MBASE_PUBLIC QStringList | logPropagateArgList |
MBASE_PUBLIC QString | logPropagateArgs |
MBASE_PUBLIC QString | verboseString |
#define VERBOSE_LEVEL_NONE (verboseMask == 0) |
Definition at line 22 of file mythlogging.h.
#define VERBOSE_LEVEL_CHECK | ( | _MASK_, | |
_LEVEL_ | |||
) |
Definition at line 24 of file mythlogging.h.
#define VERBOSE please_use_LOG_instead_of_VERBOSE |
Definition at line 33 of file mythlogging.h.
#define LOG | ( | _MASK_, | |
_LEVEL_, | |||
_STRING_ | |||
) |
Definition at line 41 of file mythlogging.h.
#define ENO (QString("\n\t\t\teno: ") + logStrerror(errno)) |
This can be appended to the LOG args with "+".
Please do not use "<<". It uses a thread safe version of strerror to produce the string representation of errno and puts it on the next line in the verbose output.
Definition at line 99 of file mythlogging.h.
#define ENO_STR ENO.toLocal8Bit().constData() |
Definition at line 100 of file mythlogging.h.
MBASE_PUBLIC 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 592 of file logging.cpp.
MBASE_PUBLIC 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 726 of file logging.cpp.
Referenced by MythCommandLineParser::ConfigureLogging().
MBASE_PUBLIC void logStop | ( | void | ) |
Entry point for stopping logging for an application.
Definition at line 759 of file logging.cpp.
Referenced by main(), MythContext::~MythContext(), and MythCoreContextPrivate::~MythCoreContextPrivate().
MBASE_PUBLIC 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 653 of file logging.cpp.
Referenced by MainServer::HandleSetLogLevel(), MainServer::HandleSetVerbose(), and logStart().
MBASE_PUBLIC bool logPropagateQuiet | ( | void | ) |
Check if we are propagating a "--quiet".
Definition at line 709 of file logging.cpp.
Referenced by BurnMenu::doBurn(), getFileDetails(), and MythSystemLegacy::SetCommand().
MBASE_PUBLIC int syslogGetFacility | ( | QString | facility | ) |
Map a syslog facility name back to the enumerated value.
facility | QString containing the facility name |
Definition at line 811 of file logging.cpp.
Referenced by MythCommandLineParser::GetSyslogFacility().
MBASE_PUBLIC 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 839 of file logging.cpp.
Referenced by MythCommandLineParser::GetLogLevel(), Myth::GetLogs(), MainServer::HandleSetLogLevel(), and verboseArgParse().
MBASE_PUBLIC 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 863 of file logging.cpp.
Referenced by MythCommandLineParser::addLogging(), Myth::GetLogs(), MainServer::HandleSetLogLevel(), logPropagateCalc(), and logStart().
MBASE_PUBLIC int verboseArgParse | ( | QString | arg | ) |
Parse the –verbose commandline argument and set the verbose level.
arg | the commandline argument following "--verbose" |
Definition at line 990 of file logging.cpp.
Referenced by MythCommandLineParser::ConfigureLogging(), MainServer::HandleSetVerbose(), and NetworkControl::processSet().
MBASE_PUBLIC QString logStrerror | ( | int | errnum | ) |
Verbose helper function for ENO macro.
errnum | system errno value |
Definition at line 1117 of file logging.cpp.
MBASE_PUBLIC LogLevel_t logLevel |
Definition at line 95 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().
MBASE_PUBLIC uint64_t verboseMask |
Definition at line 107 of file logging.cpp.
Referenced by MythCommandLineParser::ConfigureLogging(), JobQueue::GetJobCommand(), handle_command(), main(), MythSystemEventHandler::SubstituteMatches(), and verboseArgParse().
MBASE_PUBLIC ComponentLogLevelMap componentLogLevel |
Definition at line 109 of file logging.cpp.
Referenced by verboseArgParse().
MBASE_PUBLIC QStringList logPropagateArgList |
Definition at line 90 of file logging.cpp.
Referenced by logPropagateCalc(), and MythSystemLegacy::SetCommand().
MBASE_PUBLIC QString logPropagateArgs |
Definition at line 89 of file logging.cpp.
Referenced by WelcomeDialog::checkAutoStart(), BurnMenu::doBurn(), JobQueue::DoFlagCommercialsThread(), JobQueue::DoMetadataLookupThread(), RadioStreamUpdateTask::DoRun(), ArtworkTask::DoRun(), JobQueue::DoTranscodeThread(), ExternalStreamHandler::ExternalStreamHandler(), Myth::GetBackendInfo(), getFileDetails(), JobQueue::GetJobCommand(), WelcomeDialog::keyPressEvent(), ThumbGenerator::loadFile(), WelcomeDialog::lockShutdown(), logPropagateCalc(), main(), HTTPLiveStreamThread::run(), WelcomeDialog::runMythFillDatabase(), MythSystemLegacy::SetCommand(), WelcomeDialog::ShowMenu(), WelcomeDialog::shutdownNow(), LCD::startLCDServer(), WelcomeDialog::unlockShutdown(), SourceUtil::UpdateChannelsFromListings(), and WelcomeDialog::updateStatusMessage().
MBASE_PUBLIC QString verboseString |
Definition at line 108 of file logging.cpp.
Referenced by MythCommandLineParser::ConfigureLogging(), MainServer::HandleSetVerbose(), logPropagateCalc(), main(), NetworkControl::processQuery(), NetworkControl::processSet(), and verboseArgParse().