This repository contains the source code of a library, which provides a Qt widget for displaying log messages coming from the spdlog library.
- Display log messages in a tree view
- Display an icon for each log level
- Separate message structure from message content
- Search in messages
- via regular expressions
- use match case option
- reuse search history
- Auto scrolling feature with various options
- disabled
- scroll to the bottom when a new message is added
- scroll to the bottom when a new message is added unless the user scrolled up
- many more to come
- request or suggest new ones
In its initial implementation only CMake tool is considered. To use the library in your project, you have:
-
Add the library as a submodule (or any kind of folder in your machine)
git submodule add https://github.com/arsdever/qspdlog.git
-
Add the library to your CMake project
add_subdirectory(qspdlog)
-
Add the library to your target
target_link_libraries(${PROJECT_NAME} qspdlog::lib)
-
Include the interface header into the source file where you want to instantiate the widget
#include <qspdlog/qspdlog.h>
-
Instantiate the widget, register loggers and show the widget
QSpdLogWidget* widget = new QSpdLogWidget(); auto sink = widget->sink(); // register the sink to whatever logger you want widget->show();
A complete example can be found in the sample folder.
Note: In the sample it's considered that you already added the library as a submodule.
This project is licensed under the MIT License - see the LICENSE file for details.