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 ()
LogModel * model ()
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 LogManager * instance ()
static LogManager * create (QQmlEngine *, QJSEngine *)
static void installHandler (bool logOutput)
static void applyEnvironmentLogLevel ()
static void setCaptureEnabled (bool enabled)
static void clearCapturedMessages ()
static QList< LogEntry > capturedMessages (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 111 of file LogManager.cc.

References s_instance.

Member Function Documentation

◆ applyEnvironmentLogLevel()

void LogManager::applyEnvironmentLogLevel ( )
static

Definition at line 143 of file LogManager.cc.

Referenced by main().

◆ capturedMessages()

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

Definition at line 477 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 526 of file LogManager.cc.

References s_capturedMessages, s_captureEnabled, and s_captureMutex.

◆ clearCapturedMessages()

void LogManager::clearCapturedMessages ( )
static

Definition at line 471 of file LogManager.cc.

References s_capturedMessages, and s_captureMutex.

◆ clearError()

void LogManager::clearError ( )

Definition at line 329 of file LogManager.cc.

References hasErrorChanged(), and lastErrorChanged().

◆ create()

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

Definition at line 81 of file LogManager.cc.

References instance().

◆ flush()

void LogManager::flush ( )

Definition at line 339 of file LogManager.cc.

◆ hasCapturedCritical()

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

Definition at line 510 of file LogManager.cc.

References LogEntry::Critical, and hasCapturedMessage().

◆ hasCapturedMessage()

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

Definition at line 494 of file LogManager.cc.

References s_capturedMessages, and s_captureMutex.

Referenced by hasCapturedCritical(), and hasCapturedWarning().

◆ hasCapturedUncategorizedMessage()

bool LogManager::hasCapturedUncategorizedMessage ( )
staticnodiscard

Definition at line 515 of file LogManager.cc.

References s_capturedMessages, and s_captureMutex.

◆ hasCapturedWarning()

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

Definition at line 505 of file LogManager.cc.

References hasCapturedMessage(), and LogEntry::Warning.

◆ hasError()

bool LogManager::hasError ( ) const
inlinenodiscard

Definition at line 43 of file LogManager.h.

◆ hasErrorChanged

void LogManager::hasErrorChanged ( )
signal

Referenced by clearError().

◆ init()

◆ installHandler()

void LogManager::installHandler ( bool logOutput)
static

Definition at line 130 of file LogManager.cc.

References s_defaultHandler, s_echoToStderr, and s_instance.

Referenced by main().

◆ instance()

LogManager * LogManager::instance ( )
static

Definition at line 76 of file LogManager.cc.

References s_instance.

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

◆ lastError()

QString LogManager::lastError ( ) const
inlinenodiscard

Definition at line 45 of file LogManager.h.

◆ lastErrorChanged

void LogManager::lastErrorChanged ( )
signal

Referenced by clearError().

◆ logDirectory()

QString LogManager::logDirectory ( ) const
inlinenodiscard

Definition at line 49 of file LogManager.h.

◆ model()

LogModel * LogManager::model ( )
inlinenodiscard

Definition at line 41 of file LogManager.h.

◆ setCaptureEnabled()

void LogManager::setCaptureEnabled ( bool enabled)
static

Definition at line 466 of file LogManager.cc.

References s_captureEnabled.

◆ setLogDirectory()

void LogManager::setLogDirectory ( const QString & path)

Definition at line 369 of file LogManager.cc.

Referenced by init().

◆ writeFinished

void LogManager::writeFinished ( bool success)
signal

◆ writeMessages()

void LogManager::writeMessages ( const QString & destFile)

Definition at line 427 of file LogManager.cc.

◆ writeStarted

void LogManager::writeStarted ( )
signal

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