diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2014-07-22 21:22:56 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2014-07-22 21:22:56 +0000 |
commit | 126b55c7b82ce3fa42062bc3a20855b76c20b9f9 (patch) | |
tree | 432ba98bd100452ecf4da91882f11bcef70e13c9 | |
parent | 54d08ad20ccf0d4b34df080541916b302c49257f (diff) | |
download | libgphoto2-126b55c7b82ce3fa42062bc3a20855b76c20b9f9.tar.gz |
From: Axel Waggershauser <awagger@web.de>
I had something 'prepared' for this situation, here you go.. ;)
The patch does not, however, actually remove the GP_LOG_VERBOSE enum,
since that would change the interface for all clients, which might not
be worth it. If you don't think that is a problem, please remove it...
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15107 67ed7778-7388-44ab-90cf-0a291f65f57c
-rw-r--r-- | camlibs/canon/usb.c | 4 | ||||
-rw-r--r-- | libgphoto2/gphoto2-abilities-list.c | 3 | ||||
-rw-r--r-- | libgphoto2_port/libusb1/libusb1.c | 46 | ||||
-rw-r--r-- | libgphoto2_port/usb/libusb.c | 44 |
4 files changed, 29 insertions, 68 deletions
diff --git a/camlibs/canon/usb.c b/camlibs/canon/usb.c index a36d29c63..6c38c5497 100644 --- a/camlibs/canon/usb.c +++ b/camlibs/canon/usb.c @@ -1437,7 +1437,7 @@ canon_usb_dialogue_full (Camera *camera, canonCommandIndex canon_funct, unsigned } if ((payload_length + 0x50) > sizeof (packet)) { - gp_log (GP_LOG_VERBOSE, "canon/usb.c", + gp_log (GP_LOG_DEBUG, "canon/usb.c", "canon_usb_dialogue:" " payload too big, won't fit into buffer (%i > %i)", (payload_length + 0x50), (int)sizeof (packet)); @@ -1544,7 +1544,7 @@ canon_usb_dialogue_full (Camera *camera, canonCommandIndex canon_funct, unsigned reported_length, reported_length+0x40 ); if ( reported_length > 0 && reported_length+0x40 != read_bytes ) { - gp_log (GP_LOG_VERBOSE, "canon/usb.c", + gp_log (GP_LOG_DEBUG, "canon/usb.c", "canon_usb_dialogue:" " expected 0x%x bytes, but camera reports 0x%x", read_bytes, reported_length+0x40 ); diff --git a/libgphoto2/gphoto2-abilities-list.c b/libgphoto2/gphoto2-abilities-list.c index ef8837a99..86881bcd0 100644 --- a/libgphoto2/gphoto2-abilities-list.c +++ b/libgphoto2/gphoto2-abilities-list.c @@ -320,8 +320,7 @@ gp_abilities_list_detect_usb (CameraAbilitiesList *list, CHECK_RESULT (count = gp_abilities_list_count (list)); /* Detect USB cameras */ - gp_log (GP_LOG_VERBOSE, __FILE__, - "Auto-detecting USB cameras..."); + GP_LOG_D ("Auto-detecting USB cameras..."); *ability = -1; for (i = 0; i < count; i++) { int v, p, c, s; diff --git a/libgphoto2_port/libusb1/libusb1.c b/libgphoto2_port/libusb1/libusb1.c index 9e3fc3052..36a68dced 100644 --- a/libgphoto2_port/libusb1/libusb1.c +++ b/libgphoto2_port/libusb1/libusb1.c @@ -811,7 +811,7 @@ gp_port_usb_find_path_lib(GPPort *port) port->pl->d = pl->devs[d]; - gp_log (GP_LOG_VERBOSE, "libusb1", "Found path %s", port->settings.usb.port); + GP_LOG_D ("Found path %s", port->settings.usb.port); /* Use the first config, interface and altsetting we find */ gp_port_usb_find_first_altsetting(pl->devs[d], &config, &interface, &altsetting); @@ -829,11 +829,8 @@ gp_port_usb_find_path_lib(GPPort *port) port->settings.usb.intep = gp_port_usb_find_ep(pl->devs[d], config, interface, altsetting, LIBUSB_ENDPOINT_IN, LIBUSB_TRANSFER_TYPE_INTERRUPT); port->settings.usb.maxpacketsize = libusb_get_max_packet_size (pl->devs[d], port->settings.usb.inep); - gp_log (GP_LOG_VERBOSE, "libusb1", - "Detected defaults: config %d, " - "interface %d, altsetting %d, " - "inep %02x, outep %02x, intep %02x, " - "class %02x, subclass %02x", + GP_LOG_D ("Detected defaults: config %d, interface %d, altsetting %d, " + "inep %02x, outep %02x, intep %02x, class %02x, subclass %02x", port->settings.usb.config, port->settings.usb.interface, port->settings.usb.altsetting, @@ -900,10 +897,7 @@ gp_port_usb_find_device_lib(GPPort *port, int idvendor, int idproduct) port->pl->d = pl->devs[d]; - gp_log (GP_LOG_VERBOSE, "libusb1", - "Looking for USB device " - "(vendor 0x%x, product 0x%x)... found.", - idvendor, idproduct); + GP_LOG_D ("Looking for USB device (vendor 0x%x, product 0x%x)... found.", idvendor, idproduct); /* Use the first config, interface and altsetting we find */ gp_port_usb_find_first_altsetting(pl->devs[d], &config, &interface, &altsetting); @@ -914,11 +908,9 @@ gp_port_usb_find_device_lib(GPPort *port, int idvendor, int idproduct) /* Set the defaults */ if (confdesc->interface[interface].altsetting[altsetting].bInterfaceClass == LIBUSB_CLASS_MASS_STORAGE) { - gp_log (GP_LOG_VERBOSE, "libusb1", - _("USB device (vendor 0x%x, product 0x%x) is a mass" + GP_LOG_D ("USB device (vendor 0x%x, product 0x%x) is a mass" " storage device, and might not function with gphoto2." - " Reference: %s"), - idvendor, idproduct, URL_USB_MASSSTORAGE); + " Reference: %s", idvendor, idproduct, URL_USB_MASSSTORAGE); } port->settings.usb.config = confdesc->bConfigurationValue; port->settings.usb.interface = confdesc->interface[interface].altsetting[altsetting].bInterfaceNumber; @@ -929,11 +921,8 @@ gp_port_usb_find_device_lib(GPPort *port, int idvendor, int idproduct) port->settings.usb.intep = gp_port_usb_find_ep(pl->devs[d], config, interface, altsetting, LIBUSB_ENDPOINT_IN, LIBUSB_TRANSFER_TYPE_INTERRUPT); port->settings.usb.maxpacketsize = libusb_get_max_packet_size (pl->devs[d], port->settings.usb.inep); - gp_log (GP_LOG_VERBOSE, "libusb1", - "Detected defaults: config %d, " - "interface %d, altsetting %d, " - "inep %02x, outep %02x, intep %02x, " - "class %02x, subclass %02x", + GP_LOG_D ("Detected defaults: config %d, interface %d, altsetting %d, " + "inep %02x, outep %02x, intep %02x, class %02x, subclass %02x", port->settings.usb.config, port->settings.usb.interface, port->settings.usb.altsetting, @@ -1191,20 +1180,16 @@ gp_port_usb_find_device_by_class_lib(GPPort *port, int class, int subclass, int if (devnr && (devnr != libusb_get_device_address (pl->devs[d]))) continue; - gp_log (GP_LOG_VERBOSE, "gphoto2-port-usb", - "Looking for USB device " - "(class 0x%x, subclass, 0x%x, protocol 0x%x)...", - class, subclass, protocol); + GP_LOG_D ("Looking for USB device (class 0x%x, subclass, 0x%x, protocol 0x%x)...", + class, subclass, protocol); ret = gp_port_usb_match_device_by_class(pl->devs[d], class, subclass, protocol, &config, &interface, &altsetting); if (!ret) continue; port->pl->d = pl->devs[d]; - gp_log (GP_LOG_VERBOSE, "libusb1", - "Found USB class device " - "(class 0x%x, subclass, 0x%x, protocol 0x%x)", - class, subclass, protocol); + GP_LOG_D ("Found USB class device (class 0x%x, subclass, 0x%x, protocol 0x%x)", + class, subclass, protocol); if (LOG_ON_LIBUSB_E (libusb_get_config_descriptor (pl->devs[d], config, &confdesc))) continue; @@ -1225,11 +1210,8 @@ gp_port_usb_find_device_by_class_lib(GPPort *port, int class, int subclass, int break; } } - gp_log (GP_LOG_VERBOSE, "libusb1", - "Detected defaults: config %d, " - "interface %d, altsetting %d, " - "idVendor ID %04x, idProduct %04x, " - "inep %02x, outep %02x, intep %02x", + GP_LOG_D ("Detected defaults: config %d, interface %d, altsetting %d, " + "idVendor ID %04x, idProduct %04x, inep %02x, outep %02x, intep %02x", port->settings.usb.config, port->settings.usb.interface, port->settings.usb.altsetting, diff --git a/libgphoto2_port/usb/libusb.c b/libgphoto2_port/usb/libusb.c index 7903c1ddd..c4569a3bf 100644 --- a/libgphoto2_port/usb/libusb.c +++ b/libgphoto2_port/usb/libusb.c @@ -771,10 +771,7 @@ gp_port_usb_find_device_lib(GPPort *port, int idvendor, int idproduct) port->pl->d = dev; - gp_log (GP_LOG_VERBOSE, "libusb", - "Looking for USB device " - "(vendor 0x%x, product 0x%x)... found.", - idvendor, idproduct); + GP_LOG_D ("Looking for USB device (vendor 0x%x, product 0x%x)... found.", idvendor, idproduct); /* Use the first config, interface and altsetting we find */ gp_port_usb_find_first_altsetting(dev, &config, &interface, &altsetting); @@ -785,11 +782,9 @@ gp_port_usb_find_device_lib(GPPort *port, int idvendor, int idproduct) if (dev->config[config].interface[interface].altsetting[altsetting].bInterfaceClass == USB_CLASS_MASS_STORAGE) { - gp_log (GP_LOG_VERBOSE, "libusb", - _("USB device (vendor 0x%x, product 0x%x) is a mass" + GP_LOG_D ("USB device (vendor 0x%x, product 0x%x) is a mass" " storage device, and might not function with gphoto2." - " Reference: %s"), - idvendor, idproduct, URL_USB_MASSSTORAGE); + " Reference: %s", idvendor, idproduct, URL_USB_MASSSTORAGE); } port->settings.usb.config = dev->config[config].bConfigurationValue; port->settings.usb.interface = dev->config[config].interface[interface].altsetting[altsetting].bInterfaceNumber; @@ -807,11 +802,8 @@ gp_port_usb_find_device_lib(GPPort *port, int idvendor, int idproduct) break; } } - gp_log (GP_LOG_VERBOSE, "libusb", - "Detected defaults: config %d, " - "interface %d, altsetting %d, " - "inep %02x, outep %02x, intep %02x, " - "class %02x, subclass %02x", + GP_LOG_D ("Detected defaults: config %d, interface %d, altsetting %d, " + "inep %02x, outep %02x, intep %02x, class %02x, subclass %02x", port->settings.usb.config, port->settings.usb.interface, port->settings.usb.altsetting, @@ -873,7 +865,7 @@ gp_port_usb_find_path_lib(GPPort *port) port->pl->d = dev; - gp_log (GP_LOG_VERBOSE, "libusb", "Found device for path %s", port->settings.usb.port); + GP_LOG_D ("Found device for path %s", port->settings.usb.port); /* Use the first config, interface and altsetting we find */ gp_port_usb_find_first_altsetting(dev, &config, &interface, &altsetting); @@ -898,11 +890,8 @@ gp_port_usb_find_path_lib(GPPort *port) break; } } - gp_log (GP_LOG_VERBOSE, "libusb", - "Detected defaults: config %d, " - "interface %d, altsetting %d, " - "inep %02x, outep %02x, intep %02x, " - "class %02x, subclass %02x", + GP_LOG_D ("Detected defaults: config %d, interface %d, altsetting %d, " + "inep %02x, outep %02x, intep %02x, class %02x, subclass %02x", port->settings.usb.config, port->settings.usb.interface, port->settings.usb.altsetting, @@ -1167,20 +1156,14 @@ gp_port_usb_find_device_by_class_lib(GPPort *port, int class, int subclass, int if ((devname[0] != '\0') && strcmp(devname, dev->filename)) continue; - gp_log (GP_LOG_VERBOSE, "gphoto2-port-usb", - "Looking for USB device " - "(class 0x%x, subclass, 0x%x, protocol 0x%x)...", - class, subclass, protocol); + GP_LOG_D ("Looking for USB device (class 0x%x, subclass, 0x%x, protocol 0x%x)...", class, subclass, protocol); ret = gp_port_usb_match_device_by_class(dev, class, subclass, protocol, &config, &interface, &altsetting); if (!ret) continue; port->pl->d = dev; - gp_log (GP_LOG_VERBOSE, "libusb", - "Found USB class device " - "(class 0x%x, subclass, 0x%x, protocol 0x%x)", - class, subclass, protocol); + GP_LOG_D ("Found USB class device (class 0x%x, subclass, 0x%x, protocol 0x%x)", class, subclass, protocol); /* Set the defaults */ if (dev->config) { int i; @@ -1200,11 +1183,8 @@ gp_port_usb_find_device_by_class_lib(GPPort *port, int class, int subclass, int break; } } - gp_log (GP_LOG_VERBOSE, "libusb", - "Detected defaults: config %d, " - "interface %d, altsetting %d, " - "idVendor ID %04x, idProduct %04x, " - "inep %02x, outep %02x, intep %02x", + GP_LOG_D ("Detected defaults: config %d, interface %d, altsetting %d, " + "idVendor ID %04x, idProduct %04x, inep %02x, outep %02x, intep %02x", port->settings.usb.config, port->settings.usb.interface, port->settings.usb.altsetting, |