## QsLog - the simple Qt logger ##
QsLog is an easy to use logger that is based on Qt's QDebug class. QsLog is released as open source, under the MIT license.
###Contribution policy###
Bug fixes are welcome, larger changes however are not encouraged at this point due to the lack of time on my side for reviewing and integrating them. Your best bet in this case would be to open a ticket for your change or forking the project and implementing your change there, with the possibility of having it integrated in the future.
All contributions will be credited, license of the contributions should be MIT.
### Features ###
* Six logging levels (from trace to fatal)
* Logging level threshold configurable at runtime.
* Minimum overhead when logging is turned off.
* Supports multiple destinations, comes with file and debug destinations.
* Thread-safe
* Supports logging of common Qt types out of the box.
* Small dependency: just drop it in your project directly.
### Usage ###
* Include QsLog.h. Include QsLogDest.h only where you create/add destinations.
* Get the instance of the logger by calling QsLogging::Logger::instance();
* Optionally set the logging level. Info is default.
* Create as many destinations as you want by using the QsLogging::DestinationFactory.
* Add the destinations to the logger instance by calling addDestination.
**Note**: The logger does not take ownership of the destinations. Make sure that the destinations still exist when you call one of the logging macros. A good place to create the destinations is the program's main function.
### Disabling logging ###
Sometimes it's necessary to turn off logging. This can be done in several ways:
* globally, at compile time, by enabling the QS_LOG_DISABLE macro in the supplied .pri file.
* globally, at run time, by setting the log level to "OffLevel".
* per file, at compile time, by including QsLogDisableForThisFile.h in the target file.
### Thread safety ###
The Qt docs say:
A **thread-safe** function can be called simultaneously from multiple threads, even when the invocations use shared data, because all references to the shared data are serialized.
A **reentrant** function can also be called simultaneously from multiple threads, but only if each invocation uses its own data.
Since sending the log message to the destinations is protected by a mutex, the logging macros are thread-safe provided that the log has been initialized - i.e: instance() has been called.
The instance function and the setup functions (e.g: setLoggingLevel, addDestination) are NOT thread-safe and are NOT reentrant.
没有合适的资源?快使用搜索试试~ 我知道了~
一个Qt开发的开源远程控制软件(SRE),还在开发中.zip
共105个文件
h:36个
cpp:29个
dll:11个
需积分: 5 0 下载量 190 浏览量
2024-05-18
16:13:31
上传
评论
收藏 54.72MB ZIP 举报
温馨提示
一个Qt开发的开源远程控制软件(SRE),还在开发中.zip
资源推荐
资源详情
资源评论
收起资源包目录
一个Qt开发的开源远程控制软件(SRE),还在开发中.zip (105个子文件)
RecordWidget.cpp 12KB
QsLog.cpp 7KB
IndexWidget.cpp 7KB
Settings.cpp 7KB
About.cpp 6KB
QsLogDestFile.cpp 6KB
VNCClientWidget.cpp 5KB
Recorder.cpp 4KB
VNCServerWidget.cpp 4KB
CaptureVideoThread.cpp 3KB
main.cpp 3KB
QsLogDest.cpp 3KB
CaptureAudioThread.cpp 2KB
QsLogDestFunctor.cpp 2KB
QsLogDestConsole.cpp 2KB
ComOptionsBox.cpp 2KB
ClientTabWidget.cpp 2KB
ComMessageBox.cpp 2KB
FpsControl.cpp 2KB
mainwindow.cpp 2KB
SingletonUtils.cpp 1KB
ComSpinWidget.cpp 1KB
ClientDialog.cpp 1KB
ComSplitHWidget.cpp 741B
ComSplitVWidget.cpp 739B
ComLoadingWidget.cpp 738B
DesktopControlWidget.cpp 498B
ComLoadingLabel.cpp 332B
ComLineWidget.cpp 328B
avcodec-60.dll 73.74MB
avfilter-9.dll 37.76MB
avformat-60.dll 16.03MB
avdevice-60.dll 3.68MB
avutil-58.dll 2.09MB
swscale-7.dll 628KB
swresample-4.dll 428KB
postproc-57.dll 75KB
BXC_AvEncoder.dll 35KB
BXC_VideoRecorder.dll 30KB
BXC_AudioRecorder.dll 21KB
.gitignore 21B
QsLog.h 6KB
QsLogDest.h 4KB
QsLogDestFile.h 4KB
BXC_AvFrame.h 4KB
Utils.h 3KB
QsLogDestFunctor.h 3KB
Recorder.h 2KB
BXC_VideoRecorder.h 2KB
BXC_AudioRecorder.h 2KB
QsLogDestConsole.h 2KB
QsLogLevel.h 2KB
BXC_AvEncoder.h 2KB
IndexWidget.h 1KB
RecordWidget.h 1KB
FpsControl.h 1017B
SingletonUtils.h 937B
QsLogDisableForThisFile.h 702B
CaptureAudioThread.h 518B
CaptureVideoThread.h 517B
VNCClientWidget.h 495B
Settings.h 480B
ComSplitVWidget.h 476B
ComSplitHWidget.h 472B
ComOptionsBox.h 438B
constant.h 419B
ComMessageBox.h 405B
ClientDialog.h 360B
About.h 343B
ClientTabWidget.h 335B
ComSpinWidget.h 321B
DesktopControlWidget.h 307B
mainwindow.h 281B
VNCServerWidget.h 274B
ComLoadingWidget.h 249B
ComLineWidget.h 245B
ComLoadingLabel.h 242B
logo.ico 17KB
BXC_AvEncoder.lib 3KB
BXC_AudioRecorder.lib 3KB
BXC_VideoRecorder.lib 2KB
README.md 3KB
README.md 2KB
stop.png 95KB
searchblack.png 80KB
logout.png 42KB
error.png 42KB
warning.png 41KB
search.png 35KB
success.png 27KB
settings.png 25KB
password.png 23KB
logo.png 11KB
QsLog.pri 756B
Utils.pri 712B
VNCClient.pri 323B
Record.pri 300B
Index.pri 201B
VNCServer.pri 121B
3rdparty.pri 61B
共 105 条
- 1
- 2
资源评论
熬夜写代码的平头哥
- 粉丝: 3498
- 资源: 7321
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功