Mokolea / Simpleqtlogger
Licence: lgpl-2.1
Simple rolling file logger for Qt.
Stars: ✭ 60
Labels
Projects that are alternatives of or similar to Simpleqtlogger
Screencloud
Screenshot sharing application for Windows, Mac and Linux.
Stars: ✭ 537 (+795%)
Mutual labels: qt, qt5
Mlde.d.moonlightde
Modular and Qt5 light new behavior desktop environment
Stars: ✭ 40 (-33.33%)
Mutual labels: qt, qt5
Qlogo
QLogo is a rewrite of the UCBLogo language and user interface with UCB compatibility. It is cross-platform and uses hardware-accelerated graphics.
Stars: ✭ 39 (-35%)
Mutual labels: qt, qt5
Hidviz
A tool for in-depth analysis of USB HID devices communication
Stars: ✭ 505 (+741.67%)
Mutual labels: qt, qt5
Qt.go
Qt binding for Go (Golang) aims get Go's compile speed again.
Stars: ✭ 487 (+711.67%)
Mutual labels: qt, qt5
Qt Frameless Window Darkstyle
simple MainWindow class implementation with frameless window and custom dark style. It adds also support for titlebar and buttons (minimize, maximize, close)
Stars: ✭ 628 (+946.67%)
Mutual labels: qt, qt5
Taoquick
a cool QtQuick/qml component library and demo(一套酷炫的QtQuick/Qml基础库和示例)
Stars: ✭ 481 (+701.67%)
Mutual labels: qt, qt5
Singleapplication
Replacement of QtSingleApplication for Qt5 with support for instance communication.
Stars: ✭ 443 (+638.33%)
Mutual labels: qt, qt5
Derpibooru Downloader
Downloads images from derpibooru.org using a variety of options
Stars: ✭ 45 (-25%)
Mutual labels: qt, qt5
SimpleQtLogger
Simple rolling file logger for C++ applications using the Qt Framework.
Design goals - simple
- straightforward usage
- single source-file
- no configuration-file
Facts
- supported sinks:
- rolling file appender
- console, colored (ANSI escape codes)
- qDebug
- signal (forwarding)
- syslog (Linux only)
- log-levels, function-log (stack-trace)
- log-filters using regular expressions (needs Qt 5.0)
- thread-safe use of log-macros
- specify log-format
- log-file encoding: utf-8
Usage
Just see the comments in simpleQtLogger.h and the examples.
Log-format
The following TAGs are available and expand to:
TAG | Description |
---|---|
<TS> | Time-stamp, "YYYY-MM-DD HH:MM:SS.SSS" |
<TID> | Thread-Id, 64bit value in hexadecimal |
<TID32> | Thread-Id, 32bit value in hexadecimal |
<LL> | Log-level, one character: '!', 'E', 'W', 'N', 'I', 'D' or 'F' |
<TEXT> | The log-message |
<FUNC> | Function-name |
<FILE> | File-name |
<LINE> | Line-number |
Using the default log-format "<TS> [<TID>] [<LL>] <TEXT> (<FUNC>@<FILE>:<LINE>)"
creates log-entries like:
2015-10-05 17:27:26.022 [000070000019a000] [I] 03: Calculate: 6! = 720 ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:119)
Example log-file content:
Marios-iMac:Qt mario$ tail -Fn100 testSimpleQtLogger.log
2015-10-05 17:27:22.630 [00007fff7c63d000] [-] Start file-log 'main'
2015-10-05 17:27:22.631 [00007fff7c63d000] [F] \ ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:22)
2015-10-05 17:27:22.631 [00007fff7c63d000] [F] / ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:22)
2015-10-05 17:27:22.631 [00007fff7c63d000] [F] \ ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:34)
2015-10-05 17:27:22.631 [00007fff7c63d000] [I] +++ test Logger ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:36)
2015-10-05 17:27:22.631 [00007fff7c63d000] [!] L_FATAL ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:37)
2015-10-05 17:27:22.631 [00007fff7c63d000] [E] L_ERROR ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:38)
2015-10-05 17:27:22.632 [00007fff7c63d000] [W] L_WARN ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:39)
2015-10-05 17:27:22.632 [00007fff7c63d000] [I] L_INFO ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:40)
2015-10-05 17:27:22.632 [00007fff7c63d000] [I] --- test Logger ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:42)
2015-10-05 17:27:22.632 [00007fff7c63d000] [I] ? ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:44)
2015-10-05 17:27:22.632 [00007fff7c63d000] [I] Trimmed ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:45)
2015-10-05 17:27:22.632 [00007fff7c63d000] [I] UTF-8 Unicode text: äöü àéè ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:46)
2015-10-05 17:27:22.632 [00007fff7c63d000] [I] JSON output 1:
{
"firstName": "Mario",
"age": 44
} ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:54)
2015-10-05 17:27:22.632 [00007fff7c63d000] [I] JSON output 2:
{
"firstName": "Mario",
"age": 44
} ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:57)
2015-10-05 17:27:22.632 [00007fff7c63d000] [F] / ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:34)
2015-10-05 17:27:25.520 [00007fff7c63d000] [F] \ ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:74)
2015-10-05 17:27:25.520 [00007fff7c63d000] [F] .\ id='03' ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:88)
2015-10-05 17:27:25.520 [00007fff7c63d000] [F] ..\ _id='03' ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:102)
2015-10-05 17:27:25.520 [00007fff7c63d000] [F] ../ _id='03' ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:102)
2015-10-05 17:27:25.520 [00007fff7c63d000] [F] ./ id='03' ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:88)
2015-10-05 17:27:25.520 [00007fff7c63d000] [F] / ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:74)
2015-10-05 17:27:25.520 [000070000019a000] [F] \ _id='03' ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:114)
2015-10-05 17:27:26.022 [000070000019a000] [F] .\ n=6 ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:131)
2015-10-05 17:27:26.022 [000070000019a000] [F] ..\ n=5 ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:131)
2015-10-05 17:27:26.022 [000070000019a000] [F] ...\ n=4 ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:131)
2015-10-05 17:27:26.022 [000070000019a000] [F] ....\ n=3 ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:131)
2015-10-05 17:27:26.022 [000070000019a000] [F] .....\ n=2 ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:131)
2015-10-05 17:27:26.022 [000070000019a000] [F] ...../ n=2 ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:131)
2015-10-05 17:27:26.022 [000070000019a000] [F] ..../ n=3 ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:131)
2015-10-05 17:27:26.022 [000070000019a000] [F] .../ n=4 ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:131)
2015-10-05 17:27:26.022 [000070000019a000] [F] ../ n=5 ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:131)
2015-10-05 17:27:26.022 [000070000019a000] [F] ./ n=6 ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:131)
2015-10-05 17:27:26.022 [000070000019a000] [I] 03: Calculate: 6! = 720 ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:119)
2015-10-05 17:27:26.530 [00007fff7c63d000] [F] \ ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:82)
2015-10-05 17:27:26.530 [00007fff7c63d000] [I] WorkerThread: 03: Calculate: 6! = 720 ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:83)
2015-10-05 17:27:26.530 [00007fff7c63d000] [F] / ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:82)
2015-10-05 17:27:26.530 [000070000019a000] [F] / _id='03' ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:114)
2015-10-05 17:27:26.530 [00007fff7c63d000] [F] \ _id='03' ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:108)
2015-10-05 17:27:26.530 [00007fff7c63d000] [F] / _id='03' ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:108)
2015-10-05 17:27:27.883 [00007fff7c63d000] [-] Current log-file 'main' size=11964 (rotation-size=10000) --> rolling
2015-10-05 17:27:27.898 [00007fff7c63d000] [-] Log-file 'main' rolling done (time elapsed: 15 ms)
2015-10-05 17:27:28.935 [00007fff7c63d000] [F] \ ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:67)
2015-10-05 17:27:28.935 [00007fff7c63d000] [I] Bye bye ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:68)
2015-10-05 17:27:28.936 [00007fff7c63d000] [F] / ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:67)
2015-10-05 17:27:28.936 [00007fff7c63d000] [F] \ ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:28)
2015-10-05 17:27:28.936 [00007fff7c63d000] [F] / ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:28)
Marios-iMac:Qt mario$
Marios-iMac:Qt mario$ tail -Fn100 testSimpleQtLoggerWarn.log
2015-10-05 17:27:22.631 [00007fff7c63d000] [-] Start file-log 'warn'
2015-10-05 17:27:22.631 [00007fff7c63d000] [!] L_FATAL ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:37)
2015-10-05 17:27:22.631 [00007fff7c63d000] [E] L_ERROR ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:38)
2015-10-05 17:27:22.632 [00007fff7c63d000] [W] L_WARN ([email protected]/SimpleQtLogger/examples/TestSimpleQtLogger/task.cpp:39)
Marios-iMac:Qt mario$
GNU Lesser General Public License v2.1
-- Mario
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].