libusb-1.0调试信息 [英] libusb-1.0 debug informations

查看:1058
本文介绍了libusb-1.0调试信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道libusb_set_debug()是否工作。我无法从中获得任何输出。
如果我使用--enable-debug-log进行配置和构建,我可以打开调试日志记录。
如果我将libusb_set_debug()设置为3,我应该得到与enable-debug-log相同的输出吗?
我没有设置LIBUSB_DEBUG env变量。
我假设我缺少一些简单的东西。
谢谢,

解决方案

libusb调试选项不起作用。如何实际工作是这样的:



如果您使用--enable-debug-log进行配置,那么在编译时,无条件激活所有DEBUG,INFO,WARNING和ERROR所有上下文的消息。



如果使用--disable-logging配置,那么在编译时,您将无条件地停用所有级别的所有日志记录消息。



禁用调试日志并启用日志记录(默认),那么您可以使用libusb_set_debug为特定上下文请求INFO,WARNING和ERROR消息,但不能请求DEBUG级消息,尽管有一个日志记录级别。



libusb的作者似乎认为这种破坏的行为是一个功能,并不打算改变它。见:
http: //libusb.6.n5.nabble.com/does-libusb-set-debug-work-td7638.html#a7641


I’m wondering if libusb_set_debug() works. I can’t get any output from it. I can turn on debug logging if I configure and build with --enable-debug-log. Should I get about the same output as enable-debug-log if I set libusb_set_debug() to 3? I don’t have the LIBUSB_DEBUG env variable set. I assume I’m missing something simple. Thanks,

解决方案

The libusb debugging options don't work as documented. How they actually work is like this:

If you configure with --enable-debug-log then, when compiling, you unconditionally activate all DEBUG, INFO, WARNING and ERROR messages for all contexts.

If you configure with --disable-logging then, when compiling, you unconditionally deactivate all logging messages at all levels.

With debug-log disabled, and logging enabled (the default) then you can use libusb_set_debug to request INFO, WARNING and ERROR messages for particular contexts, but it is NOT possible to request DEBUG level messages, despite there being a logging level for it.

The author of libusb seems to consider this broken behaviour to be a feature, and does not plan to change it. See this: http://libusb.6.n5.nabble.com/does-libusb-set-debug-work-td7638.html#a7641

这篇关于libusb-1.0调试信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆