C# | Visual Basic | Visual C++ |
public static void SetDebug( MonoUsbSessionHandle sessionHandle, int level )
Public Shared Sub SetDebug ( _ sessionHandle As MonoUsbSessionHandle, _ level As Integer _ )
public: static void SetDebug( [InAttribute] MonoUsbSessionHandle^ sessionHandle, int level )
- sessionHandle (MonoUsbSessionHandle)
- A valid MonoUsbSessionHandle.
- level (Int32)
- Debug level to set.
- Level 0: no messages ever printed by the library. (default)
- Level 1: error messages are printed to stderr.
- Level 2: warning and error messages are printed to stderr.
- Level 3: informational messages are printed to stdout, warning and error messages are printed to stderr
The default level is 0, which means no messages are ever printed. If you choose to increase the message verbosity level, ensure that your application does not close the stdout/stderr file descriptors.
You are advised to set level 3. libusb is conservative with its message logging and most of the time, will only log messages that explain error conditions and other oddities. This will help you debug your software.
If the LIBUSB_DEBUG environment variable was set when libusb was initialized, this function does nothing: the message verbosity is fixed to the value in the environment variable.
If libusb was compiled without any message logging, this function does nothing: you'll never get any messages.
If libusb was compiled with verbose debug message logging, this function does nothing: you'll always get messages from all levels.