def configure_debug(self):
        if not self.handle:
            LOG.warning(_LW("Please consider to execute setup before trying "
                            "to configure debug log message."))
        else:
            def log_callback(ev, eh, buf, array):
                if ev == guestfs.EVENT_APPLIANCE:
                    buf = buf.rstrip()
                LOG.debug("event=%(event)s eh=%(eh)d buf='%(buf)s' "
                          "array=%(array)s", {
                              "event": guestfs.event_to_string(ev),
                              "eh": eh, "buf": buf, "array": array})

            events = (guestfs.EVENT_APPLIANCE | guestfs.EVENT_LIBRARY
                      | guestfs.EVENT_WARNING | guestfs.EVENT_TRACE)

            self.handle.set_trace(True)  # just traces libguestfs API calls
            self.handle.set_verbose(True)
            self.handle.set_event_callback(log_callback, events)
Process options passed either via arglist or via command line args.
dataset/ETHPy150Open openstack/nova/nova/virt/disk/vfs/guestfs.py/VFSGuestFS.configure_debug--crossover with--dataset/ETHPy150Open sahana/eden/static/scripts/tools/pep8.py/process_options