Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Logging Interface
LoggingInterface.png

The Logging interface can be used by plugins to print messages in OpenFlippers log widget below the gl viewer (See image). The log widget can apply filters to visualize only the messages of a certain importance. The widget has 3 different modes, which can be toggled by pressing Ctrl + L:

  • Docked automatic mode: In this mode the widget is at the bottom and will hide itself if not used.
  • Docked mode: The widget is always visible and docked at the bottom
  • Undocked: The widget is undocked into a separate window

The message importance level can be specified by the Logtype enum. There are four different levels which describe the importance and are represented by different colors in the log widget.

  • Out: Simple output messages in black
  • Info: Information messages printed in green
  • Warn: Warnings in yellow
  • Errors: Error messages printed in red

To use the LoggingInterface:

  • include LoggingInterface.hh in your plugins header file
  • derive your plugin from the class LoggingInterface
  • add Q_INTERFACES(LoggingInterface) to your plugin class
  • And add the signals or slots you want to use to your plugin class (You don't need to implement all of them)

If you use the interface, all messages printed from that plugin will be prepended with the name of the plugin to identify the origin of the message.
The following code sends a log message

emit log(LOGERR,tr("Error message"));