ImFusion SDK 4.3
LogViewerWidget Class Reference

#include <ImFusion/GUI/LogViewerWidget.h>

Logging sink that manifests itself as a Qt widget showing formatted log messages and allowing for basic filtering. More...

+ Inheritance diagram for LogViewerWidget:

Detailed Description

Logging sink that manifests itself as a Qt widget showing formatted log messages and allowing for basic filtering.

Example usage:

// Instantiate new LogViewerWidget and add it to the GUI
m_logViewerWidget = new LogViewerWidget();
m_ui.displayArea->addWidget(m_logViewerWidget);
// configure the logging sink (optional)
m_logViewerWidget->addBlacklistFilter(Log::Level::Debug, "Framework");
m_logViewerWidget->addBlacklistFilter(Log::Level::Debug, "AlgorithmFactory");
// register it with the logging system
// CAREFUL: you're passing ownership to ImFusionLog here, so make sure that
// the Qt ownership model does not interfere with it.
LogViewerWidget(QWidget *parent=nullptr)
Creates a new LogViewerWidget, however does not register it with the logging system.
void addSink(std::unique_ptr< Sink > sink)
Registers the given sink so that it will receive future log events.
@ Debug
Info messages targeting developers and not end-users.
Definition Log.h:26

Signals

void messageReceived (int level, QString category, QString message, bool isMonospace)
 

Public Member Functions

 LogViewerWidget (QWidget *parent=nullptr)
 Creates a new LogViewerWidget, however does not register it with the logging system.
 
void clearMessages ()
 Clears all log messages currently present in the widget.
 
void onGlobalLogLevelChanged ()
 
- Public Member Functions inherited from Sink
void log (const LogCapture &capture)
 Logs the given message.
 
bool isAccepted (Level level, const char *category) noexcept
 Checks whether a log message of given level and category is accepted (i.e.
 
void addWhitelistFilter (Log::Level minLevel, const std::string &category)
 Adds a whitelist filter for this logger: both conditions of the filter must be met to accept a message.
 
void addBlacklistFilter (Log::Level maxLevel, const std::string &category)
 Adds a blacklist filter for this logger: both conditions of the filter must be met to reject a message.
 
const std::vector< Filter > & whitelistFilters () const
 Return the set of whitelist filters.
 
const std::vector< Filter > & blacklistFilters () const
 Return the set of blacklist filters.
 
void removeFilters (const std::string &category)
 Removes all filters matching category.
 
void clearFilters ()
 Clear all filters.
 
bool isEnabled () const
 Returns the flag whether this logger is enabled.
 
void setEnabled (bool value)
 Sets the flag whether this logger is enabled.
 

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close