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
ca44ce50ab
commit
36eb173030
17
README.md
17
README.md
@ -50,7 +50,7 @@ $ cmake .. && make -j
|
|||||||
* syslog.
|
* syslog.
|
||||||
* Windows event log.
|
* Windows event log.
|
||||||
* Windows debugger (```OutputDebugString(..)```).
|
* Windows debugger (```OutputDebugString(..)```).
|
||||||
* Log to Qt widgets
|
* Log to Qt widgets ([example](#log-to-qt-with-nice-colors)).
|
||||||
* Easily [extendable](https://github.com/gabime/spdlog/wiki/4.-Sinks#implementing-your-own-sink) with custom log targets.
|
* Easily [extendable](https://github.com/gabime/spdlog/wiki/4.-Sinks#implementing-your-own-sink) with custom log targets.
|
||||||
* Log filtering - log levels can be modified at runtime as well as compile time.
|
* Log filtering - log levels can be modified at runtime as well as compile time.
|
||||||
* Support for loading log levels from argv or environment var.
|
* Support for loading log levels from argv or environment var.
|
||||||
@ -422,8 +422,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
|
||||||
|
|
||||||
Below are some [benchmarks](https://github.com/gabime/spdlog/blob/v1.x/bench/bench.cpp) done in Ubuntu 64 bit, Intel i7-4770 CPU @ 3.40GHz
|
Below are some [benchmarks](https://github.com/gabime/spdlog/blob/v1.x/bench/bench.cpp) done in Ubuntu 64 bit, Intel i7-4770 CPU @ 3.40GHz
|
||||||
|
Loading…
Reference in New Issue
Block a user