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
 
LogEntryoperator= (const LogEntry &)=default
 
LogEntryoperator= (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

◆ LogEntry() [2/3]

LogEntry::LogEntry ( const LogEntry )
default

◆ LogEntry() [3/3]

LogEntry::LogEntry ( LogEntry &&  )
defaultnoexcept

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

◆ columnHeaderData()

QVariant LogEntry::columnHeaderData ( int  section)
static

◆ fromQtMsgType()

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

Definition at line 29 of file LogEntry.cc.

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

◆ levelLabel()

QString LogEntry::levelLabel ( ) const

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ roleData()

◆ roleNames()

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

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: