QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
LogManager Class Reference

#include <LogManager.h>

+ Inheritance diagram for LogManager:
+ Collaboration diagram for LogManager:

Signals

void hasErrorChanged ()
 
void lastErrorChanged ()
 
void writeStarted ()
 
void writeFinished (bool success)
 

Public Member Functions

 ~LogManager ()
 
void init ()
 
LogModelmodel ()
 
bool hasError () const
 
QString lastError () const
 
void setLogDirectory (const QString &path)
 
QString logDirectory () const
 
Q_INVOKABLE void writeMessages (const QString &destFile)
 
Q_INVOKABLE void clearError ()
 
Q_INVOKABLE void flush ()
 

Static Public Member Functions

static LogManagerinstance ()
 
static LogManagercreate (QQmlEngine *qmlEngine, QJSEngine *jsEngine)
 
static void installHandler ()
 
static void applyEnvironmentLogLevel ()
 
static void setCaptureEnabled (bool enabled)
 
static void clearCapturedMessages ()
 
static QList< LogEntrycapturedMessages (const QString &category={})
 
static bool hasCapturedMessage (const QString &category, LogEntry::Level level)
 
static bool hasCapturedWarning (const QString &category)
 
static bool hasCapturedCritical (const QString &category)
 
static bool hasCapturedUncategorizedMessage ()
 
static void captureIfEnabled (QtMsgType type, const QMessageLogContext &context, const QString &msg)
 

Detailed Description

Definition at line 19 of file LogManager.h.

Constructor & Destructor Documentation

◆ ~LogManager()

LogManager::~LogManager ( )

Definition at line 102 of file LogManager.cc.

References QGCFileWriter::close(), and s_instance.

Member Function Documentation

◆ applyEnvironmentLogLevel()

void LogManager::applyEnvironmentLogLevel ( )
static

Definition at line 132 of file LogManager.cc.

Referenced by main().

◆ capturedMessages()

QList< LogEntry > LogManager::capturedMessages ( const QString &  category = {})
static

Definition at line 466 of file LogManager.cc.

References s_capturedMessages, and s_captureMutex.

◆ captureIfEnabled()

void LogManager::captureIfEnabled ( QtMsgType  type,
const QMessageLogContext &  context,
const QString &  msg 
)
static

Definition at line 515 of file LogManager.cc.

References s_capturedMessages, s_captureEnabled, and s_captureMutex.

◆ clearCapturedMessages()

void LogManager::clearCapturedMessages ( )
static

Definition at line 460 of file LogManager.cc.

References s_capturedMessages, and s_captureMutex.

◆ clearError()

void LogManager::clearError ( )

Definition at line 318 of file LogManager.cc.

References hasErrorChanged(), and lastErrorChanged().

◆ create()

LogManager * LogManager::create ( QQmlEngine *  qmlEngine,
QJSEngine *  jsEngine 
)
static

Definition at line 74 of file LogManager.cc.

References instance().

◆ flush()

void LogManager::flush ( )

Definition at line 328 of file LogManager.cc.

References QGCFileWriter::flush().

◆ hasCapturedCritical()

bool LogManager::hasCapturedCritical ( const QString &  category)
static

Definition at line 499 of file LogManager.cc.

References LogEntry::Critical, and hasCapturedMessage().

◆ hasCapturedMessage()

bool LogManager::hasCapturedMessage ( const QString &  category,
LogEntry::Level  level 
)
static

Definition at line 483 of file LogManager.cc.

References s_capturedMessages, and s_captureMutex.

Referenced by hasCapturedCritical(), and hasCapturedWarning().

◆ hasCapturedUncategorizedMessage()

bool LogManager::hasCapturedUncategorizedMessage ( )
static

Definition at line 504 of file LogManager.cc.

References s_capturedMessages, and s_captureMutex.

◆ hasCapturedWarning()

bool LogManager::hasCapturedWarning ( const QString &  category)
static

Definition at line 494 of file LogManager.cc.

References hasCapturedMessage(), and LogEntry::Warning.

◆ hasError()

bool LogManager::hasError ( ) const
inline

Definition at line 43 of file LogManager.h.

◆ hasErrorChanged

void LogManager::hasErrorChanged ( )
signal

Referenced by clearError().

◆ init()

◆ installHandler()

void LogManager::installHandler ( )
static

Definition at line 121 of file LogManager.cc.

References s_defaultHandler, and s_instance.

Referenced by main().

◆ instance()

LogManager * LogManager::instance ( )
static

Definition at line 69 of file LogManager.cc.

References s_instance.

Referenced by create(), QGCApplication::init(), and main().

◆ lastError()

QString LogManager::lastError ( ) const
inline

Definition at line 45 of file LogManager.h.

◆ lastErrorChanged

void LogManager::lastErrorChanged ( )
signal

Referenced by clearError().

◆ logDirectory()

QString LogManager::logDirectory ( ) const
inline

Definition at line 49 of file LogManager.h.

◆ model()

LogModel * LogManager::model ( )
inline

Definition at line 41 of file LogManager.h.

◆ setCaptureEnabled()

void LogManager::setCaptureEnabled ( bool  enabled)
static

Definition at line 455 of file LogManager.cc.

References s_captureEnabled.

◆ setLogDirectory()

void LogManager::setLogDirectory ( const QString &  path)

Definition at line 358 of file LogManager.cc.

References QGCFileWriter::setFilePath().

Referenced by init().

◆ writeFinished

void LogManager::writeFinished ( bool  success)
signal

◆ writeMessages()

void LogManager::writeMessages ( const QString &  destFile)

Definition at line 416 of file LogManager.cc.

References LogModel::allEntriesSnapshot().

◆ writeStarted

void LogManager::writeStarted ( )
signal

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