Hi everyone! ![]()
I’d like to share a logging library I’ve been working on that might be useful for KDE developers: QtLogger.
What is it?
QtLogger is a logging solution that integrates directly with Qt’s native logging system. The key feature is that it works with your existing qDebug(), qInfo(), qWarning(), qCritical() calls — no code changes required.
Quick Example
#include "qtlogger.h"
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
gQtLogger.configure(); // That's it!
qDebug() << "It just works!";
return app.exec();
}
Key Features
- Zero code changes — hooks into
qInstallMessageHandler() - Header-only option — just copy one file to your project
- Colored console output with pretty formatting
- Rotating logs with size-based, daily, and startup rotation + gzip compression
- Platform-native sinks: Linux syslog/systemd journal, Android logcat, macOS/iOS os_log, Windows debugger
- HTTP sink for remote logging
- JSON formatter for structured logging
- Async logging with dedicated thread for non-blocking I/O
- Category and regex filtering
- Duplicate suppression
- Fluent API for elegant configuration
- Cross-platform: Linux, Windows, macOS, iOS, Android
- Qt 5.9 — Qt 6.10 support
- C++17, MIT licensed
Why might this be useful for KDE?
- Drop-in replacement — You can add it to existing projects without touching logging calls
- systemd journal support — Native integration with journald
- Flexible pipelines — Route different log levels to different destinations
- INI file configuration — Change logging behavior without recompiling
Links
- GitHub: GitHub - yamixst/qtlogger: Simple and powerful Qt Framework logging extension
- Documentation: Available in the repo’s
doc/directory
I’d love to get feedback from the KDE community! Are there any features that would make this more useful for KDE development? Any suggestions are welcome.
Thanks for reading! ![]()