|Maintainer||Bas van Dijk <firstname.lastname@example.org>|
This module provides functionality for initializing the
Abstract type representing a USB session.
The concept of individual sessions allows your program to use multiple threads that can independently use this library without interfering with eachother.
Sessions are created and initialized by
newCtx and are automatically closed
when they are garbage collected.
Create and initialize a new USB context.
This function may throw
Note that the internal
libusb event handling can return errors. These errors
occur in the thread that is executing the event handling loop.
print these errors to
stderr. If you need to handle the errors yourself (for
example log them in an application specific way) please use
newCtx but enables you to specify the way errors should be handled
that occur while handling
Set message verbosity.
The default level is
PrintNothing. This means no messages are ever
printed. If you choose to increase the message verbosity level you must ensure
that your application does not close the
stderr file descriptors.
You are advised to set the debug level to
PrintWarnings. Libusb is
conservative with its message logging. Most of the time it will only log
messages that explain error conditions and other oddities. This will help you
debug your software.
The LIBUSB_DEBUG environment variable overrules the debug level set by this function. The message verbosity is fixed to the value in the environment variable if it is defined.
libusb was compiled without any message logging, this function does nothing:
you'll never get any messages.
libusb was compiled with verbose debug message logging, this function does
nothing: you'll always get messages from all levels.
No messages are ever printed by the library
Error messages are printed to stderr
Warning and error messages are printed to stderr
Informational messages are printed to stdout, warning and error messages are printed to stderr