mythlogging.h File Reference

Go to the source code of this file.

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.
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.
MBASE_PUBLIC void logStop (void)
 Entry point for stopping logging for an application.
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.
MBASE_PUBLIC bool logPropagateQuiet (void)
 Check if we are propagating a "--quiet".
MBASE_PUBLIC int syslogGetFacility (QString facility)
 Map a syslog facility name back to the enumerated value.
MBASE_PUBLIC LogLevel_t logLevelGet (QString level)
 Map a log level name back to the enumerated value.
MBASE_PUBLIC QString logLevelGetName (LogLevel_t level)
 Map a log level enumerated value back to the name.
MBASE_PUBLIC int verboseArgParse (QString arg)
 Parse the --verbose commandline argument and set the verbose level.
MBASE_PUBLIC QString logStrerror (int errnum)
 Verbose helper function for ENO macro.

Variables

MBASE_PUBLIC LogLevel_t logLevel
MBASE_PUBLIC uint64_t verboseMask
MBASE_PUBLIC QString logPropagateArgs
MBASE_PUBLIC QString verboseString

Function Documentation

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.

Parameters:
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.

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.

Parameters:
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().

MBASE_PUBLIC 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().

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 1108 of file logging.cpp.

Referenced by MainServer::HandleSetLogLevel(), MainServer::HandleSetVerbose(), and logStart().

MBASE_PUBLIC bool logPropagateQuiet ( void   ) 

Check if we are propagating a "--quiet".

Returns:
true if --quiet is being propagated

Definition at line 1143 of file logging.cpp.

Referenced by BurnMenu::doBurn(), ImportNative::finishedPressed(), getFileDetails(), PreviewGenerator::Run(), and ExportNative::runScript().

MBASE_PUBLIC int syslogGetFacility ( QString  facility  ) 

Map a syslog facility name back to the enumerated value.

Parameters:
facility QString containing the facility name
Returns:
Syslog facility as enumerated type. Negative if not found.

Definition at line 1291 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.

Parameters:
level QString containing the log level name
Returns:
Log level as enumerated type. LOG_UNKNOWN if not found.

Definition at line 1313 of file logging.cpp.

Referenced by MythCommandLineParser::GetLogLevel(), Myth::GetLogs(), and MainServer::HandleSetLogLevel().

MBASE_PUBLIC QString logLevelGetName ( LogLevel_t  level  ) 

Map a log level enumerated value back to the name.

Parameters:
level Enumerated value of the log level
Returns:
Log level name. "unknown" if not found.

Definition at line 1337 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.

Parameters:
arg the commandline argument following "--verbose"
Returns:
an exit code. GENERIC_EXIT_OK if all is well.

Definition at line 1460 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.

Parameters:
errnum system errno value
Returns:
QString containing the string version of the errno value, plus the errno value itself.

Definition at line 1570 of file logging.cpp.


Variable Documentation

MBASE_PUBLIC LogLevel_t logLevel
MBASE_PUBLIC uint64_t verboseMask

Definition at line 113 of file logging.cpp.

MBASE_PUBLIC QString logPropagateArgs
MBASE_PUBLIC QString verboseString
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends
Generated on Mon May 28 06:41:48 2012 for MythTV by  doxygen 1.6.3