MythTV
master
|
The logging items that are generated by LOG() and are sent to the console. More...
#include <logging.h>
Public Member Functions | |
QString | 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... | |
QString | getTimestamp (const char *format="yyyy-MM-dd HH:mm:ss") const |
Convert numerical timestamp to a readable date and time. More... | |
QString | getTimestampUs (const char *format="yyyy-MM-dd HH:mm:ss") const |
char | getLevelChar (void) |
Get the message log level as a single character. More... | |
int | pid () const |
qlonglong | tid () const |
qulonglong | threadId () const |
int | line () const |
int | type () const |
int | level () const |
int | facility () const |
std::chrono::microseconds | epoch () const |
qlonglong | epochInt () const |
QString | file () const |
QString | function () const |
QString | threadName () const |
QString | appName () const |
QString | logFile () const |
QString | message () const |
void | setPid (const int val) |
void | setTid (const qlonglong val) |
void | setThreadId (const qulonglong val) |
void | setLine (const int val) |
void | setType (const int val) |
void | setLevel (const int val) |
void | setFacility (const int val) |
void | setEpoch (std::chrono::microseconds val) |
void | setEpochInt (const qlonglong val) |
void | setFile (const QString &val) |
void | setFunction (const QString &val) |
void | setThreadName (const QString &val) |
void | setAppName (const QString &val) |
void | setLogFile (const QString &val) |
void | setMessage (const QString &val) |
![]() | |
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 *_file, const char *_function, int _line, LogLevel_t _level, LoggingType _type) |
Create a new LoggingItem. More... | |
![]() | |
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 {UINT64_MAX} |
int | m_line {0} |
LoggingType | m_type {kMessage} |
LogLevel_t | m_level {LOG_INFO} |
int | m_facility {0} |
std::chrono::microseconds | m_epoch {0us} |
QString | m_file {} |
QString | m_function {} |
QString | m_threadName {} |
QString | m_appName {} |
QString | m_logFile {} |
QString | m_message {} |
![]() | |
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 |
int | line |
int | type |
int | level |
int | facility |
qlonglong | epoch |
QString | file |
QString | function |
QString | threadName |
QString | appName |
QString | logFile |
QString | message |
Private Member Functions | |
LoggingItem () | |
LoggingItem (const char *_file, const char *_function, int _line, LogLevel_t _level, LoggingType _type) | |
Q_DISABLE_COPY (LoggingItem) | |
Friends | |
class | LoggerThread |
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... | |
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 122 of file logging.cpp.
QString LoggingItem::getThreadName | ( | void | ) |
Get the name of the thread that produced the LoggingItem.
Definition at line 137 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 153 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 166 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 510 of file logging.cpp.
Referenced by loggingDeregisterThread(), loggingRegisterThread(), and LogPrintLine().
QString LoggingItem::getTimestamp | ( | const char * | format = "yyyy-MM-dd HH:mm:ss" | ) | const |
Convert numerical timestamp to a readable date and time.
Definition at line 191 of file logging.cpp.
Referenced by getTimestampUs().
QString LoggingItem::getTimestampUs | ( | const char * | format = "yyyy-MM-dd HH:mm:ss" | ) | const |
Definition at line 198 of file logging.cpp.
Referenced by LoggerThread::logConsole(), and FileLogger::logmsg().
char LoggingItem::getLevelChar | ( | void | ) |
Get the message log level as a single character.
Definition at line 206 of file logging.cpp.
Referenced by LoggerThread::logConsole(), and FileLogger::logmsg().
|
inline |
|
inline |
Definition at line 102 of file logging.h.
Referenced by LoggerThread::fillItem().
|
inline |
|
inline |
Definition at line 108 of file logging.h.
Referenced by LoggerThread::fillItem().
|
inline |
Definition at line 109 of file logging.h.
Referenced by setEpochInt().
|
inline |
|
inline |
|
inline |
Definition at line 113 of file logging.h.
Referenced by LoggerThread::fillItem(), and loggingRegisterThread().
|
inline |
Definition at line 114 of file logging.h.
Referenced by LoggerThread::fillItem().
|
inline |
Definition at line 115 of file logging.h.
Referenced by LoggerThread::fillItem().
|
inline |
|
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 |
message | log message |
Definition at line 528 of file logging.cpp.
|
protected |
|
protected |
Definition at line 120 of file logging.h.
Referenced by getThreadTid(), LoggerThread::handleItem(), setThreadTid(), setTid(), and tid().
|
protected |
Definition at line 121 of file logging.h.
Referenced by getThreadName(), getThreadTid(), LoggerThread::handleItem(), setThreadId(), setThreadTid(), and threadId().
|
protected |
Definition at line 122 of file logging.h.
Referenced by line(), LoggerThread::logConsole(), and setLine().
|
protected |
Definition at line 123 of file logging.h.
Referenced by LoggerThread::handleItem(), LoggerThread::logConsole(), setType(), and type().
|
protected |
Definition at line 124 of file logging.h.
Referenced by getLevelChar(), level(), LoggerThread::logConsole(), and setLevel().
|
protected |
Definition at line 125 of file logging.h.
Referenced by facility(), and setFacility().
|
protected |
Definition at line 126 of file logging.h.
Referenced by epoch(), epochInt(), getTimestamp(), getTimestampUs(), LoggingItem(), and setEpoch().
|
protected |
Definition at line 127 of file logging.h.
Referenced by file(), LoggerThread::logConsole(), LoggingItem(), and setFile().
|
protected |
Definition at line 128 of file logging.h.
Referenced by function(), LoggerThread::logConsole(), and setFunction().
|
protected |
Definition at line 129 of file logging.h.
Referenced by getThreadName(), LoggerThread::handleItem(), setThreadName(), and threadName().
|
protected |
Definition at line 130 of file logging.h.
Referenced by appName(), and setAppName().
|
protected |
Definition at line 131 of file logging.h.
Referenced by logFile(), and setLogFile().
|
protected |
Definition at line 132 of file logging.h.
Referenced by LoggerThread::handleItem(), LoggerThread::logConsole(), LogPrintLine(), message(), and setMessage().
|
readwrite |
Definition at line 57 of file logging.h.
Referenced by LoggerThread::logConsole(), and FileLogger::logmsg().
|
readwrite |
Definition at line 58 of file logging.h.
Referenced by LoggerThread::logConsole(), and FileLogger::logmsg().
|
readwrite |
Definition at line 60 of file logging.h.
Referenced by FileLogger::logmsg().
|
readwrite |
Definition at line 63 of file logging.h.
Referenced by LogForwardThread::forwardMessage().
|
readwrite |
Definition at line 64 of file logging.h.
Referenced by getTimestamp().
|
readwrite |
Definition at line 65 of file logging.h.
Referenced by FileLogger::logmsg().
|
readwrite |
Definition at line 66 of file logging.h.
Referenced by FileLogger::logmsg().
|
readwrite |
Definition at line 67 of file logging.h.
Referenced by LoggerThread::logConsole(), and FileLogger::logmsg().
|
readwrite |
Definition at line 69 of file logging.h.
Referenced by LogForwardThread::forwardMessage().
|
readwrite |
Definition at line 70 of file logging.h.
Referenced by musicbrainzngs.musicbrainz.WebServiceError::__str__(), and FileLogger::logmsg().