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 | LOG(_MASK_, _LEVEL_, _QSTRING_) |
#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, QString message) |
Format and send a log message into the queue. More... | |
static bool | VERBOSE_LEVEL_NONE () |
static bool | VERBOSE_LEVEL_CHECK (uint64_t mask, LogLevel_t level) |
MBASE_PUBLIC void | resetLogging (void) |
Intended for use only by the test harness. More... | |
MBASE_PUBLIC void | logStart (const QString &logfile, bool progress=false, int quiet=0, int facility=0, LogLevel_t level=LOG_INFO, bool propagate=false, bool testHarness=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 (const QString &facility) |
MBASE_PUBLIC LogLevel_t | logLevelGet (const 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 (const 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 LOG | ( | _MASK_, | |
_LEVEL_, | |||
_QSTRING_ | |||
) |
Definition at line 39 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 73 of file mythlogging.h.
#define ENO_STR ENO.toLocal8Bit().constData() |
Definition at line 74 of file mythlogging.h.
MBASE_PUBLIC void LogPrintLine | ( | uint64_t | mask, |
LogLevel_t | level, | ||
const char * | file, | ||
int | line, | ||
const char * | function, | ||
QString | message | ||
) |
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 |
message | log message |
Definition at line 528 of file logging.cpp.
|
inlinestatic |
Definition at line 28 of file mythlogging.h.
Referenced by ChannelScannerCLI::HandleEvent(), ChannelScannerWeb::HandleEvent(), ChannelScannerCLI::InformUser(), ChannelScannerCLI::MonitorProgress(), and myth_av_log().
|
inlinestatic |
Definition at line 29 of file mythlogging.h.
Referenced by SubtitleReader::AddAVSubtitle(), HTTPRequest::AddCORSHeaders(), MPEG2fixup::AddSequence(), avfDecoder::avfDecoder(), MythOpenGLPainter::Begin(), MHIContext::BeginStream(), CC608Decoder::BufferCC(), MPEG2fixup::ConvertToI(), MythRenderOpenGL::Create(), MythRenderOpenGL::CreateComputeShader(), MythRenderOpenGL::CreateShaderProgram(), MythEGLDMABUF::CreateTextures(), MythVideoColourSpace::Debug(), MythHTTPServer::DebugHosts(), MythDisplay::DebugModes(), MythHTTPServer::DebugOrigins(), MythRenderVulkan::DebugVulkan(), ProgramData::DeleteOverlaps(), SubtitleScreen::DisplayAVSubtitles(), SSDPCache::Dump(), MythPlayerUI::EnableFrameRateMonitor(), MythPainterVulkan::End(), MythOpenGLPainter::End(), MythVideoOutputOpenGL::EndFrame(), MSqlQuery::exec(), AutoExpire::ExpireEpisodesOverMax(), Scheduler::FillRecordingDir(), MythMediaDevice::findMountPath(), CardUtil::GetConflictingInputs(), MediaMonitorUnix::GetDeviceFile(), MainServer::GetFilesystemInfos(), MythHTTPParser::GetRequest(), FillData::GrabData(), ChannelScannerCLI::HandleEvent(), ChannelScannerWeb::HandleEvent(), MythRenderOpenGL::Init(), MPEG2fixup::InitAV(), CdDecoder::initialize(), MythRenderVulkan::initResources(), MPEG2fixup::InsertFrame(), InteractiveTV::InteractiveTV(), ChannelGroupSetting::LoadChannelGroup(), ImageLoader::LoadImage(), ChannelScanSM::LogLines(), myth_av_log(), myth_libass_log(), MythPainterWindowVulkan::MythPainterWindowVulkan(), MythVideoOutputOpenGL::MythVideoOutputOpenGL(), MythWindowVulkan::MythWindowVulkan(), ImportRecorder::Open(), DVBChannel::Open(), MythHTTPRanges::ParseRanges(), MythVideoVulkan::PrepareFrame(), MythVideoOutputOpenGL::PrepareFrame(), MythOpenGLVideo::PrepareFrame(), AudioInputALSA::PrepHwParams(), Scheduler::PrintList(), Scheduler::PrintRec(), MPEGStreamData::ProcessTSPacket(), MPEG2fixup::ProcessVideo(), EITCache::PruneOldEntries(), MythRAOPConnection::readClient(), MythSocket::ReadStringListReal(), MythRenderOpenGL::ReleaseResources(), MythVideoOutputVulkan::RenderEnd(), MythVideoOutputVulkan::RenderFrame(), MythVideoOutputOpenGL::RenderFrame(), MythOpenGLVideo::RenderFrame(), HDHRStreamHandler::run(), AvFormatDecoder::ScanStreams(), Scheduler::SchedNewRecords(), MSqlQuery::seekDebug(), AutoExpire::SendDeleteMessages(), RecorderBase::SetRingBuffer(), LiveTVChain::SwitchTo(), Transcode::TranscodeFile(), DVBChannel::Tune(), HouseKeeperTask::UpdateLastRun(), Scheduler::UpdateMatches(), MythWebSocket::Write(), MythSocket::WriteStringListReal(), and MythOpenGLPainter::~MythOpenGLPainter().
MBASE_PUBLIC void resetLogging | ( | void | ) |
Intended for use only by the test harness.
Definition at line 111 of file logging.cpp.
MBASE_PUBLIC void logStart | ( | const QString & | logfile, |
bool | progress, | ||
int | quiet, | ||
int | facility, | ||
LogLevel_t | level, | ||
bool | propagate, | ||
bool | testHarness | ||
) |
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 |
propagate | true if the logfile path needs to be propagated to child processes. |
testHarness | Should always be false. Set to true when invoked by the testing code. |
Definition at line 637 of file logging.cpp.
Referenced by MythCommandLineParser::ConfigureLogging().
MBASE_PUBLIC void logStop | ( | void | ) |
Entry point for stopping logging for an application.
Definition at line 669 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 572 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 619 of file logging.cpp.
Referenced by BurnMenu::doBurn(), getFileDetails(), and MythSystemLegacy::SetCommand().
MBASE_PUBLIC int syslogGetFacility | ( | const QString & | facility | ) |
MBASE_PUBLIC LogLevel_t logLevelGet | ( | const QString & | level | ) |
Map a log level name back to the enumerated value.
level | QString containing the log level name |
Definition at line 746 of file logging.cpp.
Referenced by MythCommandLineParser::GetLogLevel(), Myth::GetLogs(), V2Myth::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 768 of file logging.cpp.
Referenced by MythCommandLineParser::addLogging(), Myth::GetLogs(), V2Myth::GetLogs(), MainServer::HandleSetLogLevel(), logPropagateCalc(), and logStart().
MBASE_PUBLIC int verboseArgParse | ( | const QString & | arg | ) |
Parse the –verbose commandline argument and set the verbose level.
arg | the commandline argument following "--verbose" |
Definition at line 894 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 1019 of file logging.cpp.
Referenced by DVBChannel::DrainDVBEvents().
MBASE_PUBLIC LogLevel_t logLevel |
Definition at line 85 of file logging.cpp.
Referenced by handle_command(), MainServer::HandleSetLogLevel(), logPropagateCalc(), logStart(), main(), MHSetLogging(), PrintOutput::Output(), pid_counter(), pid_filter(), pid_printer(), MythSocket::ReadStringListReal(), VERBOSE_LEVEL_CHECK(), and MythSocket::WriteStringListReal().
MBASE_PUBLIC uint64_t verboseMask |
Definition at line 97 of file logging.cpp.
Referenced by MythCommandLineParser::ConfigureLogging(), JobQueue::GetJobCommand(), handle_command(), main(), resetLogging(), MythSystemEventHandler::SubstituteMatches(), VERBOSE_LEVEL_CHECK(), VERBOSE_LEVEL_NONE(), and verboseArgParse().
MBASE_PUBLIC ComponentLogLevelMap componentLogLevel |
Definition at line 99 of file logging.cpp.
Referenced by VERBOSE_LEVEL_CHECK(), and verboseArgParse().
MBASE_PUBLIC QStringList logPropagateArgList |
Definition at line 83 of file logging.cpp.
Referenced by logPropagateCalc(), and MythSystemLegacy::SetCommand().
MBASE_PUBLIC QString logPropagateArgs |
Definition at line 82 of file logging.cpp.
Referenced by WelcomeDialog::checkAutoStart(), BurnMenu::doBurn(), JobQueue::DoFlagCommercialsThread(), JobQueue::DoMetadataLookupThread(), RadioStreamUpdateTask::DoRun(), ArtworkTask::DoRun(), JobQueue::DoTranscodeThread(), ExternalStreamHandler::ExternalStreamHandler(), Myth::GetBackendInfo(), V2Myth::GetBackendInfo(), getFileDetails(), JobQueue::GetJobCommand(), WelcomeDialog::keyPressEvent(), WelcomeDialog::lockShutdown(), logPropagateCalc(), main(), HTTPLiveStreamThread::run(), WelcomeDialog::runMythFillDatabase(), MythSystemLegacy::SetCommand(), WelcomeDialog::ShowMenu(), WelcomeDialog::shutdownNow(), LCD::startLCDServer(), MythSystemEventHandler::SubstituteMatches(), WelcomeDialog::unlockShutdown(), SourceUtil::UpdateChannelsFromListings(), and WelcomeDialog::updateStatusMessage().
MBASE_PUBLIC QString verboseString |
Definition at line 98 of file logging.cpp.
Referenced by MythCommandLineParser::ConfigureLogging(), MainServer::HandleSetVerbose(), logPropagateCalc(), main(), NetworkControl::processQuery(), NetworkControl::processSet(), resetLogging(), and verboseArgParse().