MythTV
master
|
The logging items that are generated by LOG() and are sent to the console. More...
#include <logging.h>
Public Member Functions | |
char * | getThreadName (void) |
Get the name of the thread that produced the LoggingItem. More... | |
int64_t | getThreadTid (void) |
Get the thread ID of the thread that produced the LoggingItem. More... | |
void | setThreadTid (void) |
Set the thread ID of the thread that produced the LoggingItem. More... | |
QByteArray | toByteArray (void) |
int | pid () const |
qlonglong | tid () const |
qulonglong | threadId () const |
uint | usec () const |
int | line () const |
int | type () const |
int | level () const |
int | facility () const |
qlonglong | epoch () const |
QString | file () const |
QString | function () const |
QString | threadName () const |
QString | appName () const |
QString | table () const |
QString | logFile () const |
QString | message () const |
void | setPid (const int val) |
void | setTid (const qlonglong val) |
void | setThreadId (const qulonglong val) |
void | setUsec (const uint val) |
void | setLine (const int val) |
void | setType (const int val) |
void | setLevel (const int val) |
void | setFacility (const int val) |
void | setEpoch (const qlonglong val) |
void | setFile (const QString &val) SET_LOGGING_ARG(m_file) void setFunction(const QString &val) SET_LOGGING_ARG(m_function) void setThreadName(const QString &val) SET_LOGGING_ARG(m_threadName) void setAppName(const QString &val) SET_LOGGING_ARG(m_appName) void setTable(const QString &val) SET_LOGGING_ARG(m_table) void setLogFile(const QString &val) SET_LOGGING_ARG(m_logFile) void setMessage(const QString &val) |
const char * | rawFile () const |
const char * | rawFunction () const |
const char * | rawThreadName () const |
const char * | rawAppName () const |
const char * | rawTable () const |
const char * | rawLogFile () const |
const char * | rawMessage () const |
![]() | |
ReferenceCounter (const QString &debugName, bool logDebug=true) | |
Creates reference counter with an initial value of 1. More... | |
virtual int | IncrRef (void) |
Increments reference count. More... | |
virtual int | DecrRef (void) |
Decrements reference count and deletes on 0. More... | |
Static Public Member Functions | |
static LoggingItem * | create (const char *, const char *, int, LogLevel_t, LoggingType) |
Create a new LoggingItem. More... | |
static LoggingItem * | create (QByteArray &buf) |
![]() | |
static void | PrintDebug (void) |
Print out any leaks if that level of debugging is enabled. More... | |
Protected Attributes | |
int | m_pid {-1} |
qlonglong | m_tid {-1} |
qulonglong | m_threadId {(qulonglong)-1} |
uint | m_usec {0} |
int | m_line {0} |
LoggingType | m_type {kMessage} |
LogLevel_t | m_level {LOG_INFO} |
int | m_facility {0} |
qlonglong | m_epoch {0} |
char * | m_file {nullptr} |
char * | m_function {nullptr} |
char * | m_threadName {nullptr} |
char * | m_appName {nullptr} |
char * | m_table {nullptr} |
char * | m_logFile {nullptr} |
char | m_message [LOGLINE_MAX+1] {0} |
![]() | |
bool | m_logDebug |
This is used to suppress creating LoggingItem classes for LoggingItem reference count changes. More... | |
QAtomicInt | m_referenceCount {1} |
Properties | |
int | pid |
qlonglong | tid |
qulonglong | threadId |
uint | usec |
int | line |
int | type |
int | level |
int | facility |
qlonglong | epoch |
QString | file |
QString | function |
QString | threadName |
QString | appName |
QString | table |
QString | logFile |
QString | message |
Private Member Functions | |
LoggingItem () | |
LoggingItem (const char *_file, const char *_function, int _line, LogLevel_t _level, LoggingType _type) | |
~LoggingItem () | |
Q_DISABLE_COPY (LoggingItem) | |
Friends | |
class | LoggerThread |
void | LogPrintLine (uint64_t, LogLevel_t, const char *, int, const char *, int, const char *,...) |
Format and send a log message into the queue. More... | |
Additional Inherited Members | |
![]() | |
virtual | ~ReferenceCounter (void) |
Called on destruction, will warn if object deleted with references in place. More... | |
The logging items that are generated by LOG() and are sent to the console.
|
inlineprivate |
|
private |
Definition at line 140 of file logging.cpp.
|
private |
Definition at line 151 of file logging.cpp.
char * LoggingItem::getThreadName | ( | void | ) |
Get the name of the thread that produced the LoggingItem.
Definition at line 178 of file logging.cpp.
Referenced by LoggerThread::fillItem().
int64_t LoggingItem::getThreadTid | ( | void | ) |
Get the thread ID of the thread that produced the LoggingItem.
Definition at line 194 of file logging.cpp.
Referenced by LoggerThread::handleItem().
void LoggingItem::setThreadTid | ( | void | ) |
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()
Definition at line 207 of file logging.cpp.
Referenced by LoggingItem().
|
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 551 of file logging.cpp.
Referenced by LogForwardThread::forwardMessage(), loggingDeregisterThread(), loggingRegisterThread(), and LogPrintLine().
|
static |
Definition at line 561 of file logging.cpp.
QByteArray LoggingItem::toByteArray | ( | void | ) |
Definition at line 166 of file logging.cpp.
Referenced by LoggerThread::handleItem().
|
inline |
Definition at line 113 of file logging.h.
Referenced by LoggerThread::fillItem().
|
inline |
|
inline |
Definition at line 120 of file logging.h.
Referenced by LoggerThread::fillItem().
|
inline |
|
inline |
Definition at line 134 of file logging.h.
Referenced by FileLogger::logmsg().
|
inline |
Definition at line 135 of file logging.h.
Referenced by FileLogger::logmsg().
|
inline |
Definition at line 136 of file logging.h.
Referenced by LoggerThread::logConsole(), and FileLogger::logmsg().
|
inline |
Definition at line 140 of file logging.h.
Referenced by FileLogger::logmsg().
|
private |
|
friend |
|
friend |
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 584 of file logging.cpp.
|
protected |
|
protected |
Definition at line 144 of file logging.h.
Referenced by getThreadTid(), LoggerThread::handleItem(), setThreadTid(), setTid(), and tid().
|
protected |
Definition at line 145 of file logging.h.
Referenced by getThreadName(), getThreadTid(), LoggerThread::handleItem(), setThreadId(), setThreadTid(), and threadId().
|
protected |
Definition at line 146 of file logging.h.
Referenced by LoggerThread::logConsole(), LoggingItem(), setUsec(), and usec().
|
protected |
Definition at line 147 of file logging.h.
Referenced by line(), LoggerThread::logConsole(), and setLine().
|
protected |
Definition at line 148 of file logging.h.
Referenced by LoggerThread::handleItem(), LoggerThread::logConsole(), setType(), and type().
|
protected |
Definition at line 149 of file logging.h.
Referenced by level(), LoggerThread::logConsole(), and setLevel().
|
protected |
Definition at line 150 of file logging.h.
Referenced by facility(), and setFacility().
|
protected |
Definition at line 151 of file logging.h.
Referenced by epoch(), LoggingItem(), and setEpoch().
|
protected |
Definition at line 152 of file logging.h.
Referenced by file(), LoggerThread::logConsole(), rawFile(), and ~LoggingItem().
|
protected |
Definition at line 153 of file logging.h.
Referenced by function(), LoggerThread::logConsole(), rawFunction(), and ~LoggingItem().
|
protected |
Definition at line 154 of file logging.h.
Referenced by getThreadName(), LoggerThread::handleItem(), rawThreadName(), threadName(), and ~LoggingItem().
|
protected |
Definition at line 155 of file logging.h.
Referenced by appName(), rawAppName(), and ~LoggingItem().
|
protected |
Definition at line 156 of file logging.h.
Referenced by rawTable(), table(), and ~LoggingItem().
|
protected |
Definition at line 157 of file logging.h.
Referenced by logFile(), rawLogFile(), and ~LoggingItem().
|
protected |
Definition at line 158 of file logging.h.
Referenced by LoggerThread::handleItem(), LoggerThread::logConsole(), LogPrintLine(), message(), rawMessage(), and setFile().
|
readwrite |
Definition at line 66 of file logging.h.
Referenced by LoggerThread::logConsole(), FileLogger::logmsg(), and DatabaseLogger::logqmsg().
|
readwrite |
Definition at line 67 of file logging.h.
Referenced by LoggerThread::logConsole(), FileLogger::logmsg(), and DatabaseLogger::logqmsg().
|
readwrite |
Definition at line 69 of file logging.h.
Referenced by FileLogger::logmsg().
|
readwrite |
Definition at line 70 of file logging.h.
Referenced by FileLogger::logmsg(), and DatabaseLogger::logqmsg().
|
readwrite |
Definition at line 72 of file logging.h.
Referenced by FileLogger::logmsg(), and DatabaseLogger::logqmsg().
|
readwrite |
Definition at line 73 of file logging.h.
Referenced by LogForwardThread::forwardMessage().
|
readwrite |
Definition at line 74 of file logging.h.
Referenced by LoggerThread::logConsole(), FileLogger::logmsg(), and DatabaseLogger::logqmsg().
|
readwrite |
Definition at line 75 of file logging.h.
Referenced by DatabaseLogger::logqmsg().
|
readwrite |
Definition at line 76 of file logging.h.
Referenced by DatabaseLogger::logqmsg().
|
readwrite |
Definition at line 77 of file logging.h.
Referenced by DatabaseLogger::logqmsg().
|
readwrite |
Definition at line 78 of file logging.h.
Referenced by DatabaseLogger::logqmsg().
|
readwrite |
Definition at line 79 of file logging.h.
Referenced by LogForwardThread::forwardMessage().
|
readwrite |
Definition at line 80 of file logging.h.
Referenced by LogForwardThread::forwardMessage().
|
readwrite |
Definition at line 81 of file logging.h.
Referenced by musicbrainzngs.musicbrainz.WebServiceError::__str__(), DatabaseLogger::logqmsg(), and DBLoggerThread::run().