Method: LIBUSB::Context#set_log_cb
- Defined in:
- lib/libusb/context.rb
permalink #set_log_cb(mode) {|context, level, str| ... } ⇒ Object
Set log handler.
libusb will redirect its log messages to the provided method block. libusb supports redirection of per context and global log messages. Log messages sent to the context will be sent to the global log handler too.
If libusb is compiled without message logging or USE_SYSTEM_LOGGING_FACILITY is defined then global callback function will never be called. If ENABLE_DEBUG_LOGGING is defined then per context callback function will never be called.
To disable the log callback, execute set_log_cb without a block.
Available since libusb-1.0.23, LIBUSB_API_VERSION >= 0x01000107
269 270 271 272 273 |
# File 'lib/libusb/context.rb', line 269 def set_log_cb(mode, &block) cb_proc = wrap_log_cb(block, mode) Call.libusb_set_log_cb(@ctx, cb_proc, mode) self end |