QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
LogEntry Struct Reference

#include <LogEntry.h>

Public Types

enum  Level {
  Debug = 0 , Info = 1 , Warning = 2 , Critical = 3 ,
  Fatal = 4
}
enum  Role {
  TimestampRole = Qt::UserRole + 1 , LevelRole , LevelLabelRole , CategoryRole ,
  MessageRole , FormattedRole , FileRole , FunctionRole ,
  LineRole , ThreadIdRole
}
enum  Column {
  MessageColumn = 0 , CategoryColumn , TimestampColumn , SourceColumn ,
  ColumnCount
}

Public Member Functions

 LogEntry ()=default
 LogEntry (const LogEntry &)=default
 LogEntry (LogEntry &&) noexcept=default
LogEntry & operator= (const LogEntry &)=default
LogEntry & operator= (LogEntry &&) noexcept=default
QString levelLabel () const
void buildFormatted ()
QVariant roleData (int role) const
QVariant columnDisplayData (int column) const

Static Public Member Functions

static Level fromQtMsgType (QtMsgType type)
static QHash< int, QByteArray > roleNames ()
static QVariant columnHeaderData (int section)

Public Attributes

QDateTime timestamp
Level level = Debug
QString category
QString message
QString file
QString function
QString formatted
Qt::HANDLE threadId = nullptr
qint64 elapsedMs = 0
int line = 0

Detailed Description

Definition at line 7 of file LogEntry.h.

Member Enumeration Documentation

◆ Column

Enumerator
MessageColumn 
CategoryColumn 
TimestampColumn 
SourceColumn 
ColumnCount 

Definition at line 67 of file LogEntry.h.

◆ Level

Enumerator
Debug 
Info 
Warning 
Critical 
Fatal 

Definition at line 21 of file LogEntry.h.

◆ Role

Enumerator
TimestampRole 
LevelRole 
LevelLabelRole 
CategoryRole 
MessageRole 
FormattedRole 
FileRole 
FunctionRole 
LineRole 
ThreadIdRole 

Definition at line 53 of file LogEntry.h.

Constructor & Destructor Documentation

◆ LogEntry() [1/3]

LogEntry::LogEntry ( )
default

References LogEntry().

Referenced by LogEntry(), LogEntry(), LogEntry(), operator=(), and operator=().

◆ LogEntry() [2/3]

LogEntry::LogEntry ( const LogEntry & )
default

References LogEntry().

◆ LogEntry() [3/3]

LogEntry::LogEntry ( LogEntry && )
defaultnoexcept

References LogEntry().

Member Function Documentation

◆ buildFormatted()

void LogEntry::buildFormatted ( )

Definition at line 23 of file LogEntry.cc.

References category, formatted, levelLabel(), message, and timestamp.

◆ columnDisplayData()

QVariant LogEntry::columnDisplayData ( int column) const
nodiscard

◆ columnHeaderData()

QVariant LogEntry::columnHeaderData ( int section)
staticnodiscard

◆ fromQtMsgType()

LogEntry::Level LogEntry::fromQtMsgType ( QtMsgType type)
staticnodiscard

Definition at line 29 of file LogEntry.cc.

References Critical, Debug, Fatal, Info, and Warning.

◆ levelLabel()

QString LogEntry::levelLabel ( ) const
nodiscard

◆ operator=() [1/2]

LogEntry & LogEntry::operator= ( const LogEntry & )
default

References LogEntry().

◆ operator=() [2/2]

LogEntry & LogEntry::operator= ( LogEntry && )
defaultnoexcept

References LogEntry().

◆ roleData()

◆ roleNames()

QHash< int, QByteArray > LogEntry::roleNames ( )
staticnodiscard

Member Data Documentation

◆ category

QString LogEntry::category

◆ elapsedMs

qint64 LogEntry::elapsedMs = 0

Definition at line 45 of file LogEntry.h.

Referenced by columnDisplayData().

◆ file

QString LogEntry::file

Definition at line 41 of file LogEntry.h.

Referenced by columnDisplayData(), LogFormatter::formatCsvRow(), and roleData().

◆ formatted

QString LogEntry::formatted

Definition at line 43 of file LogEntry.h.

Referenced by buildFormatted(), and roleData().

◆ function

QString LogEntry::function

Definition at line 42 of file LogEntry.h.

Referenced by roleData().

◆ level

Level LogEntry::level = Debug

Definition at line 38 of file LogEntry.h.

Referenced by LogFormatter::entryToJson(), levelLabel(), and roleData().

◆ line

int LogEntry::line = 0

Definition at line 46 of file LogEntry.h.

Referenced by columnDisplayData(), LogFormatter::formatCsvRow(), and roleData().

◆ message

QString LogEntry::message

◆ threadId

Qt::HANDLE LogEntry::threadId = nullptr

Definition at line 44 of file LogEntry.h.

Referenced by roleData().

◆ timestamp

QDateTime LogEntry::timestamp

The documentation for this struct was generated from the following files: