]> sigrok.org Git - libsigrok.git/commitdiff
hantek-dso: Use message logging helpers.
authorUwe Hermann <redacted>
Tue, 29 Jan 2013 11:05:00 +0000 (12:05 +0100)
committerUwe Hermann <redacted>
Tue, 29 Jan 2013 11:56:02 +0000 (12:56 +0100)
hardware/hantek-dso/dso.c
hardware/hantek-dso/dso.h

index 3006380d1c66b95efd03f7847a047d3561dd27f1..66d6978f24bbd3d720d8796bc8315c7cfafd1b6a 100644 (file)
@@ -237,7 +237,7 @@ static int get_channel_offsets(struct dev_context *devc)
                                        devc->channel_levels[chan][v][0],
                                        devc->channel_levels[chan][v][1]);
                        }
-                       sr_dbg(gs->str);
+                       sr_dbg("%s", gs->str);
                }
                g_string_free(gs, TRUE);
        }
@@ -505,7 +505,7 @@ SR_PRIV int dso_set_relays(struct dev_context *devc)
                g_string_printf(gs, "Relays:");
                for (i = 0; i < 17; i++)
                        g_string_append_printf(gs, " %.2x", relays[i]);
-               sr_dbg(gs->str);
+               sr_dbg("%s", gs->str);
                g_string_free(gs, TRUE);
        }
 
index 5f766f9fcb60f8da570020b967cb8fbfaa0a0133..beabbd5b205fac7810b6c6ba167dbd5169b508ec 100644 (file)
 #ifndef LIBSIGROK_HARDWARE_HANTEK_DSO_H
 #define LIBSIGROK_HARDWARE_HANTEK_DSO_H
 
+/* Message logging helpers with driver-specific prefix string. */
+#define DRIVER_LOG_DOMAIN "hantek-dso: "
+#define sr_log(l, s, args...) sr_log(l, DRIVER_LOG_DOMAIN s, ## args)
+#define sr_spew(s, args...) sr_spew(DRIVER_LOG_DOMAIN s, ## args)
+#define sr_dbg(s, args...) sr_dbg(DRIVER_LOG_DOMAIN s, ## args)
+#define sr_info(s, args...) sr_info(DRIVER_LOG_DOMAIN s, ## args)
+#define sr_warn(s, args...) sr_warn(DRIVER_LOG_DOMAIN s, ## args)
+#define sr_err(s, args...) sr_err(DRIVER_LOG_DOMAIN s, ## args)
+
 #define USB_INTERFACE                  0
 #define USB_CONFIGURATION              1
 #define DSO_EP_IN                      0x86