mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
Updated README.md with qt color example
This commit is contained in:
parent
1f61f5e019
commit
f0e1f22bbc
15
README.md
15
README.md
@ -420,6 +420,21 @@ void replace_default_logger_example()
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
#### Log to Qt with nice colors
|
||||||
|
```c++
|
||||||
|
#include "spdlog/spdlog.h"
|
||||||
|
#include "spdlog/sinks/qt_sinks.h"
|
||||||
|
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
|
||||||
|
{
|
||||||
|
setMinimumSize(640, 480);
|
||||||
|
auto log_widget = new QTextEdit(this);
|
||||||
|
setCentralWidget(log_widget);
|
||||||
|
auto logger = spdlog::qt_color_logger_mt("qt_logger", log_widget);
|
||||||
|
logger->info("Some info message");
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
## Benchmarks
|
## Benchmarks
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user