From 3544f848e0d7f67af8e11ce7ec344b34cd797df3 Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Mon, 23 Dec 2013 03:38:35 +0000 Subject: [PATCH] Centralise duplicated logging helper defines. --- backend.c | 2 ++ device.c | 9 +-------- filter.c | 9 +-------- hardware/agilent-dmm/agilent-dmm.h | 9 +-------- hardware/alsa/protocol.h | 9 +-------- hardware/appa-55ii/protocol.h | 9 +-------- hardware/asix-sigma/asix-sigma.h | 9 +-------- hardware/brymen-dmm/protocol.h | 9 +-------- hardware/cem-dt-885x/protocol.h | 9 +-------- hardware/center-3xx/protocol.h | 9 +-------- hardware/chronovu-la8/protocol.h | 9 +-------- hardware/colead-slm/protocol.h | 9 +-------- hardware/common/dmm/es51922.c | 9 +-------- hardware/common/dmm/es519xx.c | 9 +-------- hardware/common/dmm/fs9721.c | 9 +-------- hardware/common/dmm/fs9922.c | 9 +-------- hardware/common/dmm/m2110.c | 9 --------- hardware/common/dmm/metex14.c | 9 +-------- hardware/common/dmm/rs9lcd.c | 9 +-------- hardware/common/ezusb.c | 9 +-------- hardware/common/scpi.c | 8 +------- hardware/common/scpi_serial.c | 8 +------- hardware/common/scpi_tcp.c | 8 +------- hardware/common/scpi_usbtmc.c | 8 +------- hardware/common/serial.c | 9 +-------- hardware/common/usb.c | 9 +-------- hardware/demo/demo.c | 9 +-------- hardware/fluke-dmm/fluke-dmm.h | 9 +-------- hardware/fx2lafw/protocol.h | 9 +-------- hardware/gmc-mh-1x-2x/protocol.h | 9 +-------- hardware/hameg-hmo/protocol.h | 9 +-------- hardware/hantek-dso/dso.h | 9 +-------- hardware/ikalogic-scanalogic2/protocol.h | 9 +-------- hardware/ikalogic-scanaplus/protocol.h | 9 +-------- hardware/kecheng-kc-330b/protocol.h | 9 +-------- hardware/lascar-el-usb/protocol.h | 9 +-------- hardware/link-mso19/protocol.h | 9 +-------- hardware/mic-985xx/protocol.h | 9 +-------- hardware/norma-dmm/protocol.h | 9 +-------- hardware/openbench-logic-sniffer/protocol.h | 9 +-------- hardware/rigol-ds/protocol.h | 9 +-------- hardware/saleae-logic16/protocol.h | 9 +-------- hardware/serial-dmm/protocol.h | 9 +-------- hardware/teleinfo/protocol.h | 9 +-------- hardware/tondaj-sl-814/protocol.h | 9 +-------- hardware/uni-t-dmm/protocol.h | 9 +-------- hardware/uni-t-ut32x/protocol.h | 9 +-------- hardware/victor-dmm/protocol.h | 9 +-------- hardware/zeroplus-logic-cube/protocol.h | 9 +-------- hwdriver.c | 9 +-------- input/binary.c | 9 +-------- input/chronovu_la8.c | 9 +-------- input/csv.c | 9 +-------- input/vcd.c | 9 +-------- input/wav.c | 9 +-------- libsigrok-internal.h | 10 ++++++++++ log.c | 1 + output/analog.c | 9 +-------- output/binary.c | 9 +-------- output/chronovu_la8.c | 9 +-------- output/csv.c | 9 +-------- output/gnuplot.c | 9 +-------- output/ols.c | 9 +-------- output/text/ascii.c | 9 +-------- output/text/bits.c | 9 +-------- output/text/hex.c | 9 +-------- output/text/text.c | 9 +-------- output/vcd.c | 9 +-------- session.c | 9 +-------- session_driver.c | 9 +-------- session_file.c | 9 +-------- std.c | 2 ++ strutil.c | 9 +-------- 73 files changed, 83 insertions(+), 549 deletions(-) diff --git a/backend.c b/backend.c index f290e579..4e657ac5 100644 --- a/backend.c +++ b/backend.c @@ -23,6 +23,8 @@ #include "libsigrok.h" #include "libsigrok-internal.h" +#define LOG_PREFIX "backend" + extern struct sr_session *session; /** diff --git a/device.c b/device.c index e5411a45..87031a9a 100644 --- a/device.c +++ b/device.c @@ -23,14 +23,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "device: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "device" /** * @file diff --git a/filter.c b/filter.c index 11610157..eaf69e5c 100644 --- a/filter.c +++ b/filter.c @@ -24,14 +24,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "filter: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "filter" /** * @file diff --git a/hardware/agilent-dmm/agilent-dmm.h b/hardware/agilent-dmm/agilent-dmm.h index 43fed240..2277111f 100644 --- a/hardware/agilent-dmm/agilent-dmm.h +++ b/hardware/agilent-dmm/agilent-dmm.h @@ -20,14 +20,7 @@ #ifndef LIBSIGROK_HARDWARE_AGILENT_DMM_AGILENT_DMM_H #define LIBSIGROK_HARDWARE_AGILENT_DMM_AGILENT_DMM_H -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "agilent-dmm: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "agilent-dmm" #define AGDMM_BUFSIZE 256 diff --git a/hardware/alsa/protocol.h b/hardware/alsa/protocol.h index e844bc74..d8688929 100644 --- a/hardware/alsa/protocol.h +++ b/hardware/alsa/protocol.h @@ -28,14 +28,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "alsa: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "alsa" /** Private, per-device-instance driver context. */ struct dev_context { diff --git a/hardware/appa-55ii/protocol.h b/hardware/appa-55ii/protocol.h index d7c83858..38a35564 100644 --- a/hardware/appa-55ii/protocol.h +++ b/hardware/appa-55ii/protocol.h @@ -25,14 +25,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "appa-55ii: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "appa-55ii" #define APPA_55II_NUM_PROBES 2 #define APPA_55II_BUF_SIZE (4 + 32 + 1) diff --git a/hardware/asix-sigma/asix-sigma.h b/hardware/asix-sigma/asix-sigma.h index 0fbcd936..74178b1c 100644 --- a/hardware/asix-sigma/asix-sigma.h +++ b/hardware/asix-sigma/asix-sigma.h @@ -22,14 +22,7 @@ #ifndef LIBSIGROK_HARDWARE_ASIX_SIGMA_ASIX_SIGMA_H #define LIBSIGROK_HARDWARE_ASIX_SIGMA_ASIX_SIGMA_H -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "asix-sigma: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "asix-sigma" enum sigma_write_register { WRITE_CLOCK_SELECT = 0, diff --git a/hardware/brymen-dmm/protocol.h b/hardware/brymen-dmm/protocol.h index 28bf38f5..e6d2e560 100644 --- a/hardware/brymen-dmm/protocol.h +++ b/hardware/brymen-dmm/protocol.h @@ -28,14 +28,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "brymen-dmm: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "brymen-dmm" #define DMM_BUFSIZE 256 diff --git a/hardware/cem-dt-885x/protocol.h b/hardware/cem-dt-885x/protocol.h index 85a0ea77..233ef860 100644 --- a/hardware/cem-dt-885x/protocol.h +++ b/hardware/cem-dt-885x/protocol.h @@ -25,14 +25,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "cem-dt-885x: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "cem-dt-885x" /* When retrieving samples from device memory, group this many * together into a sigrok packet. */ diff --git a/hardware/center-3xx/protocol.h b/hardware/center-3xx/protocol.h index 10179db3..71e2630d 100644 --- a/hardware/center-3xx/protocol.h +++ b/hardware/center-3xx/protocol.h @@ -29,14 +29,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "center-3xx: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "center-3xx" /* Note: When adding entries here, don't forget to update CENTER_DEV_COUNT. */ enum { diff --git a/hardware/chronovu-la8/protocol.h b/hardware/chronovu-la8/protocol.h index 80926550..cd71936c 100644 --- a/hardware/chronovu-la8/protocol.h +++ b/hardware/chronovu-la8/protocol.h @@ -27,14 +27,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "la8: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "la8" #define USB_VENDOR_ID 0x0403 #define USB_DESCRIPTION "ChronoVu LA8" diff --git a/hardware/colead-slm/protocol.h b/hardware/colead-slm/protocol.h index 1460f4d6..8942ac85 100644 --- a/hardware/colead-slm/protocol.h +++ b/hardware/colead-slm/protocol.h @@ -24,14 +24,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "colead-slm: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "colead-slm" enum { IDLE, diff --git a/hardware/common/dmm/es51922.c b/hardware/common/dmm/es51922.c index 09563f93..cadd7cb7 100644 --- a/hardware/common/dmm/es51922.c +++ b/hardware/common/dmm/es51922.c @@ -31,14 +31,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "es51922: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "es51922" /* Factors for the respective measurement mode (0 means "invalid"). */ static const float factors[8][8] = { diff --git a/hardware/common/dmm/es519xx.c b/hardware/common/dmm/es519xx.c index a3f5efbd..99942295 100644 --- a/hardware/common/dmm/es519xx.c +++ b/hardware/common/dmm/es519xx.c @@ -32,14 +32,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "es519xx: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "es519xx" /* Factors for the respective measurement mode (0 means "invalid"). */ static const float factors_2400_11b[8][8] = { diff --git a/hardware/common/dmm/fs9721.c b/hardware/common/dmm/fs9721.c index 705da3cc..9b195d0b 100644 --- a/hardware/common/dmm/fs9721.c +++ b/hardware/common/dmm/fs9721.c @@ -38,14 +38,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "fs9721: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "fs9721" static int parse_digit(uint8_t b) { diff --git a/hardware/common/dmm/fs9922.c b/hardware/common/dmm/fs9922.c index 51d3c654..c5fd63b8 100644 --- a/hardware/common/dmm/fs9922.c +++ b/hardware/common/dmm/fs9922.c @@ -29,14 +29,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "fs9922: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "fs9922" static gboolean flags_valid(const struct fs9922_info *info) { diff --git a/hardware/common/dmm/m2110.c b/hardware/common/dmm/m2110.c index 9184ab4f..8a84420f 100644 --- a/hardware/common/dmm/m2110.c +++ b/hardware/common/dmm/m2110.c @@ -31,15 +31,6 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "bbcgm-m2110: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) - SR_PRIV gboolean sr_m2110_packet_valid(const uint8_t *buf) { float val; diff --git a/hardware/common/dmm/metex14.c b/hardware/common/dmm/metex14.c index 4a37efe0..4e66c97c 100644 --- a/hardware/common/dmm/metex14.c +++ b/hardware/common/dmm/metex14.c @@ -34,14 +34,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "metex14: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "metex14" static int parse_value(const uint8_t *buf, float *result) { diff --git a/hardware/common/dmm/rs9lcd.c b/hardware/common/dmm/rs9lcd.c index 4328aefd..4f6b0680 100644 --- a/hardware/common/dmm/rs9lcd.c +++ b/hardware/common/dmm/rs9lcd.c @@ -35,14 +35,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "rs9lcd: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "rs91lcd" /* Byte 1 of the packet, and the modes it represents */ #define IND1_HZ (1 << 7) diff --git a/hardware/common/ezusb.c b/hardware/common/ezusb.c index 476ccb21..044b4642 100644 --- a/hardware/common/ezusb.c +++ b/hardware/common/ezusb.c @@ -30,14 +30,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "ezusb: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "ezusb" SR_PRIV int ezusb_reset(struct libusb_device_handle *hdl, int set_clear) { diff --git a/hardware/common/scpi.c b/hardware/common/scpi.c index 4992b736..78a06fd1 100644 --- a/hardware/common/scpi.c +++ b/hardware/common/scpi.c @@ -23,13 +23,7 @@ #include #include -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "scpi: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) +#define LOG_PREFIX "scpi" #define SCPI_READ_RETRIES 100 #define SCPI_READ_RETRY_TIMEOUT 10000 diff --git a/hardware/common/scpi_serial.c b/hardware/common/scpi_serial.c index 6c5415c5..dc099634 100644 --- a/hardware/common/scpi_serial.c +++ b/hardware/common/scpi_serial.c @@ -24,13 +24,7 @@ #include #include -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "scpi_serial: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) +#define LOG_PREFIX "scpi_serial" #define SCPI_READ_RETRIES 100 #define SCPI_READ_RETRY_TIMEOUT 10000 diff --git a/hardware/common/scpi_tcp.c b/hardware/common/scpi_tcp.c index e4572871..af2db140 100644 --- a/hardware/common/scpi_tcp.c +++ b/hardware/common/scpi_tcp.c @@ -37,13 +37,7 @@ #endif #include -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "scpi_tcp: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) +#define LOG_PREFIX "scpi_tcp" struct scpi_tcp { char *address; diff --git a/hardware/common/scpi_usbtmc.c b/hardware/common/scpi_usbtmc.c index 9648722c..298e3ab5 100644 --- a/hardware/common/scpi_usbtmc.c +++ b/hardware/common/scpi_usbtmc.c @@ -26,13 +26,7 @@ #include #include -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "scpi_usbtmc: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) +#define LOG_PREFIX "scpi_usbtmc" SR_PRIV int scpi_usbtmc_open(void *priv) { diff --git a/hardware/common/serial.c b/hardware/common/serial.c index 891fd02d..a7376af0 100644 --- a/hardware/common/serial.c +++ b/hardware/common/serial.c @@ -26,14 +26,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "serial: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "serial" /** * Open the specified serial port. diff --git a/hardware/common/usb.c b/hardware/common/usb.c index 0de54b90..6e678fdb 100644 --- a/hardware/common/usb.c +++ b/hardware/common/usb.c @@ -33,14 +33,7 @@ #define SUBCLASS_USBTMC 0x03 #define USBTMC_USB488 0x01 -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "usb: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "usb" /** * Find USB devices according to a connection string. diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index d4836b89..f5ba2596 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -31,14 +31,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "demo: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "demo" /* TODO: Number of probes should be configurable. */ #define NUM_PROBES 8 diff --git a/hardware/fluke-dmm/fluke-dmm.h b/hardware/fluke-dmm/fluke-dmm.h index f1ec8ce9..4291be06 100644 --- a/hardware/fluke-dmm/fluke-dmm.h +++ b/hardware/fluke-dmm/fluke-dmm.h @@ -20,14 +20,7 @@ #ifndef LIBSIGROK_HARDWARE_FLUKE_DMM_FLUKE_DMM_H #define LIBSIGROK_HARDWARE_FLUKE_DMM_FLUKE_DMM_H -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "fluke-dmm: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "fluke-dmm" #define FLUKEDMM_BUFSIZE 256 diff --git a/hardware/fx2lafw/protocol.h b/hardware/fx2lafw/protocol.h index 76ef63d5..c23db39a 100644 --- a/hardware/fx2lafw/protocol.h +++ b/hardware/fx2lafw/protocol.h @@ -29,14 +29,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "fx2lafw: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "fx2lafw" #define USB_INTERFACE 0 #define USB_CONFIGURATION 1 diff --git a/hardware/gmc-mh-1x-2x/protocol.h b/hardware/gmc-mh-1x-2x/protocol.h index e3a4ce42..9d742e3c 100644 --- a/hardware/gmc-mh-1x-2x/protocol.h +++ b/hardware/gmc-mh-1x-2x/protocol.h @@ -25,14 +25,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "gmc-mh-1x-2x: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "gmc-mh-1x-2x" #define GMC_BUFSIZE 266 diff --git a/hardware/hameg-hmo/protocol.h b/hardware/hameg-hmo/protocol.h index 370bc008..ffc84128 100644 --- a/hardware/hameg-hmo/protocol.h +++ b/hardware/hameg-hmo/protocol.h @@ -26,14 +26,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "hameg-hmo: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "hameg-hmo" #define MAX_INSTRUMENT_VERSIONS 10 #define MAX_COMMAND_SIZE 31 diff --git a/hardware/hantek-dso/dso.h b/hardware/hantek-dso/dso.h index 2c4f4c39..16826db2 100644 --- a/hardware/hantek-dso/dso.h +++ b/hardware/hantek-dso/dso.h @@ -22,14 +22,7 @@ #ifndef LIBSIGROK_HARDWARE_HANTEK_DSO_DSO_H #define LIBSIGROK_HARDWARE_HANTEK_DSO_DSO_H -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "hantek-dso: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "hantek-dso" #define USB_INTERFACE 0 #define USB_CONFIGURATION 1 diff --git a/hardware/ikalogic-scanalogic2/protocol.h b/hardware/ikalogic-scanalogic2/protocol.h index 8324204e..add5dda8 100644 --- a/hardware/ikalogic-scanalogic2/protocol.h +++ b/hardware/ikalogic-scanalogic2/protocol.h @@ -27,14 +27,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "ikalogic-scanalogic2: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "ikalogic-scanalogic2" #define VENDOR_NAME "IKALOGIC" #define MODEL_NAME "Scanalogic-2" diff --git a/hardware/ikalogic-scanaplus/protocol.h b/hardware/ikalogic-scanaplus/protocol.h index e736f838..dd7660da 100644 --- a/hardware/ikalogic-scanaplus/protocol.h +++ b/hardware/ikalogic-scanaplus/protocol.h @@ -28,14 +28,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "scanaplus: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "scanaplus" #define COMPRESSED_BUF_SIZE (64 * 1024) diff --git a/hardware/kecheng-kc-330b/protocol.h b/hardware/kecheng-kc-330b/protocol.h index eabda85b..09152b9f 100644 --- a/hardware/kecheng-kc-330b/protocol.h +++ b/hardware/kecheng-kc-330b/protocol.h @@ -25,14 +25,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "kecheng-kc-330b: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "kecheng-kc-330b" #define EP_IN 0x80 | 1 #define EP_OUT 2 diff --git a/hardware/lascar-el-usb/protocol.h b/hardware/lascar-el-usb/protocol.h index 16e826a0..4386ef4b 100644 --- a/hardware/lascar-el-usb/protocol.h +++ b/hardware/lascar-el-usb/protocol.h @@ -24,14 +24,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "lascar-el-usb: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "lascar-el-usb" #define LASCAR_VENDOR "Lascar" #define LASCAR_INTERFACE 0 diff --git a/hardware/link-mso19/protocol.h b/hardware/link-mso19/protocol.h index e4d7e999..85426723 100644 --- a/hardware/link-mso19/protocol.h +++ b/hardware/link-mso19/protocol.h @@ -29,14 +29,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "mso19: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "mso19" #define USB_VENDOR "3195" #define USB_PRODUCT "f190" diff --git a/hardware/mic-985xx/protocol.h b/hardware/mic-985xx/protocol.h index 5b2efb3a..279cca5b 100644 --- a/hardware/mic-985xx/protocol.h +++ b/hardware/mic-985xx/protocol.h @@ -28,14 +28,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "mic-985xx: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "mic-985xx" /* Note: When adding entries here, don't forget to update MIC_DEV_COUNT. */ enum { diff --git a/hardware/norma-dmm/protocol.h b/hardware/norma-dmm/protocol.h index e9a956e3..2ed0e250 100644 --- a/hardware/norma-dmm/protocol.h +++ b/hardware/norma-dmm/protocol.h @@ -29,14 +29,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "norma-dmm: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "norma-dmm" #define NMADMM_BUFSIZE 256 diff --git a/hardware/openbench-logic-sniffer/protocol.h b/hardware/openbench-logic-sniffer/protocol.h index b9e16e9c..333605ee 100644 --- a/hardware/openbench-logic-sniffer/protocol.h +++ b/hardware/openbench-logic-sniffer/protocol.h @@ -26,14 +26,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "ols: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "ols" #define NUM_PROBES 32 #define NUM_TRIGGER_STAGES 4 diff --git a/hardware/rigol-ds/protocol.h b/hardware/rigol-ds/protocol.h index 853fbe6e..d1c67fd8 100644 --- a/hardware/rigol-ds/protocol.h +++ b/hardware/rigol-ds/protocol.h @@ -26,14 +26,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "rigol-ds: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "rigol-ds" #define DS1000_ANALOG_LIVE_WAVEFORM_SIZE 600 #define DS2000_ANALOG_LIVE_WAVEFORM_SIZE 1400 diff --git a/hardware/saleae-logic16/protocol.h b/hardware/saleae-logic16/protocol.h index 6faa8b68..db19498a 100644 --- a/hardware/saleae-logic16/protocol.h +++ b/hardware/saleae-logic16/protocol.h @@ -27,14 +27,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "saleae-logic16: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "saleae-logic16" enum voltage_range { VOLTAGE_RANGE_UNKNOWN, diff --git a/hardware/serial-dmm/protocol.h b/hardware/serial-dmm/protocol.h index 57d5ea19..22264573 100644 --- a/hardware/serial-dmm/protocol.h +++ b/hardware/serial-dmm/protocol.h @@ -20,14 +20,7 @@ #ifndef LIBSIGROK_HARDWARE_SERIAL_DMM_PROTOCOL_H #define LIBSIGROK_HARDWARE_SERIAL_DMM_PROTOCOL_H -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "serial-dmm: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "serial-dmm" /* Note: When adding entries here, don't forget to update DMM_COUNT. */ enum { diff --git a/hardware/teleinfo/protocol.h b/hardware/teleinfo/protocol.h index 46d2efb3..f95c50eb 100644 --- a/hardware/teleinfo/protocol.h +++ b/hardware/teleinfo/protocol.h @@ -25,14 +25,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "teleinfo: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "teleinfo" enum optarif { OPTARIF_NONE, diff --git a/hardware/tondaj-sl-814/protocol.h b/hardware/tondaj-sl-814/protocol.h index 5ff051d5..027b66df 100644 --- a/hardware/tondaj-sl-814/protocol.h +++ b/hardware/tondaj-sl-814/protocol.h @@ -25,14 +25,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "tondaj-sl-814: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "tondaj-sl-814" /** Private, per-device-instance driver context. */ struct dev_context { diff --git a/hardware/uni-t-dmm/protocol.h b/hardware/uni-t-dmm/protocol.h index ea8a1a4c..a6a8f718 100644 --- a/hardware/uni-t-dmm/protocol.h +++ b/hardware/uni-t-dmm/protocol.h @@ -27,14 +27,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "uni-t-dmm: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "uni-t-dmm" enum { TECPEL_DMM_8061, diff --git a/hardware/uni-t-ut32x/protocol.h b/hardware/uni-t-ut32x/protocol.h index 42cf01d1..8513117c 100644 --- a/hardware/uni-t-ut32x/protocol.h +++ b/hardware/uni-t-ut32x/protocol.h @@ -25,14 +25,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "uni-t-ut32x: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "uni-t-ut32x" #define DEFAULT_DATA_SOURCE DATA_SOURCE_LIVE #define USB_CONN "1a86.e008" diff --git a/hardware/victor-dmm/protocol.h b/hardware/victor-dmm/protocol.h index 92539004..8f126803 100644 --- a/hardware/victor-dmm/protocol.h +++ b/hardware/victor-dmm/protocol.h @@ -24,14 +24,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "victor-dmm: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "victor-dmm" #define DMM_DATA_SIZE 14 diff --git a/hardware/zeroplus-logic-cube/protocol.h b/hardware/zeroplus-logic-cube/protocol.h index 64fca809..718dd217 100644 --- a/hardware/zeroplus-logic-cube/protocol.h +++ b/hardware/zeroplus-logic-cube/protocol.h @@ -28,14 +28,7 @@ #include "libsigrok-internal.h" #include "analyzer.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "zeroplus: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "zeroplus" /* Private, per-device-instance driver context. */ struct dev_context { diff --git a/hwdriver.c b/hwdriver.c index a94acc9e..83582ad2 100644 --- a/hwdriver.c +++ b/hwdriver.c @@ -27,14 +27,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "hwdriver: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "hwdriver" /** * @file diff --git a/input/binary.c b/input/binary.c index 70bad29c..dfeedee7 100644 --- a/input/binary.c +++ b/input/binary.c @@ -26,14 +26,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "input/binary: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "input/binary" #define CHUNKSIZE (512 * 1024) #define DEFAULT_NUM_PROBES 8 diff --git a/input/chronovu_la8.c b/input/chronovu_la8.c index 0fa21adc..4c785427 100644 --- a/input/chronovu_la8.c +++ b/input/chronovu_la8.c @@ -25,14 +25,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "input/chronovu-la8: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "input/chronovu-l8" #define NUM_PACKETS 2048 #define PACKET_SIZE 4096 diff --git a/input/csv.c b/input/csv.c index e11c554a..65c6b3f9 100644 --- a/input/csv.c +++ b/input/csv.c @@ -23,14 +23,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "input/csv: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "input/csv" /* * The CSV input module has the following options: diff --git a/input/vcd.c b/input/vcd.c index b10da20b..d20d4a64 100644 --- a/input/vcd.c +++ b/input/vcd.c @@ -63,14 +63,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "input/vcd: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "input/vcd" #define DEFAULT_NUM_PROBES 8 #define CHUNKSIZE 1024 diff --git a/input/wav.c b/input/wav.c index 92f6bfb5..0106a586 100644 --- a/input/wav.c +++ b/input/wav.c @@ -25,14 +25,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "input/wav: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "input/wav" #define CHUNK_SIZE 4096 diff --git a/libsigrok-internal.h b/libsigrok-internal.h index 82d6d791..61978c29 100644 --- a/libsigrok-internal.h +++ b/libsigrok-internal.h @@ -162,6 +162,16 @@ SR_PRIV int sr_info(const char *format, ...); SR_PRIV int sr_warn(const char *format, ...); SR_PRIV int sr_err(const char *format, ...); +/* Message logging helpers with subsystem-specific prefix string. */ +#ifndef NO_LOG_WRAPPERS +#define sr_log(l, s, args...) sr_log(l, "%s: " s, LOG_PREFIX, ## args) +#define sr_spew(s, args...) sr_spew("%s: " s, LOG_PREFIX, ## args) +#define sr_dbg(s, args...) sr_dbg("%s: " s, LOG_PREFIX, ## args) +#define sr_info(s, args...) sr_info("%s: " s, LOG_PREFIX, ## args) +#define sr_warn(s, args...) sr_warn("%s: " s, LOG_PREFIX, ## args) +#define sr_err(s, args...) sr_err("%s: " s, LOG_PREFIX, ## args) +#endif + /*--- device.c --------------------------------------------------------------*/ SR_PRIV struct sr_probe *sr_probe_new(int index, int type, diff --git a/log.c b/log.c index d6b29302..a4ca4bc5 100644 --- a/log.c +++ b/log.c @@ -21,6 +21,7 @@ #include #include #include "libsigrok.h" +#define NO_LOG_WRAPPERS #include "libsigrok-internal.h" /** diff --git a/output/analog.c b/output/analog.c index 58341e13..9873a8f5 100644 --- a/output/analog.c +++ b/output/analog.c @@ -24,14 +24,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "output/analog: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "output/analog" struct context { int num_enabled_probes; diff --git a/output/binary.c b/output/binary.c index 2fd858eb..dd0cf474 100644 --- a/output/binary.c +++ b/output/binary.c @@ -24,14 +24,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "output/binary: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "output/binary:" static int data(struct sr_output *o, const uint8_t *data_in, uint64_t length_in, uint8_t **data_out, uint64_t *length_out) diff --git a/output/chronovu_la8.c b/output/chronovu_la8.c index 54fbfa34..47b421d9 100644 --- a/output/chronovu_la8.c +++ b/output/chronovu_la8.c @@ -24,14 +24,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "output/chronovu-la8: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "output/chronovu-la8" struct context { unsigned int num_enabled_probes; diff --git a/output/csv.c b/output/csv.c index 3eda9bf9..51cc8572 100644 --- a/output/csv.c +++ b/output/csv.c @@ -25,14 +25,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "output/csv: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "output/csv" struct context { unsigned int num_enabled_probes; diff --git a/output/gnuplot.c b/output/gnuplot.c index e93556f8..29508cef 100644 --- a/output/gnuplot.c +++ b/output/gnuplot.c @@ -25,14 +25,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "output/gnuplot: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "output/gnuplot" struct context { unsigned int num_enabled_probes; diff --git a/output/ols.c b/output/ols.c index 3c6e5941..0e220534 100644 --- a/output/ols.c +++ b/output/ols.c @@ -31,14 +31,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "output/ols: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "output/ols" struct context { uint64_t samplerate; diff --git a/output/text/ascii.c b/output/text/ascii.c index 147ff60e..61c5a2ad 100644 --- a/output/text/ascii.c +++ b/output/text/ascii.c @@ -25,14 +25,7 @@ #include "libsigrok-internal.h" #include "text.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "output/ascii: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "output/ascii" SR_PRIV int init_ascii(struct sr_output *o) { diff --git a/output/text/bits.c b/output/text/bits.c index e0a9812c..ff149650 100644 --- a/output/text/bits.c +++ b/output/text/bits.c @@ -25,14 +25,7 @@ #include "libsigrok-internal.h" #include "text.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "output/bits: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "output/bits" SR_PRIV int init_bits(struct sr_output *o) { diff --git a/output/text/hex.c b/output/text/hex.c index 1c2757cc..e9102608 100644 --- a/output/text/hex.c +++ b/output/text/hex.c @@ -25,14 +25,7 @@ #include "libsigrok-internal.h" #include "text.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "output/hex: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "output/hex" SR_PRIV int init_hex(struct sr_output *o) { diff --git a/output/text/text.c b/output/text/text.c index 7263224d..68566121 100644 --- a/output/text/text.c +++ b/output/text/text.c @@ -27,14 +27,7 @@ #include "libsigrok-internal.h" #include "text.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "output/text: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "output/text" SR_PRIV void flush_linebufs(struct context *ctx, uint8_t *outbuf) { diff --git a/output/vcd.c b/output/vcd.c index 60ec58c3..d1526c1b 100644 --- a/output/vcd.c +++ b/output/vcd.c @@ -26,14 +26,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "output/vcd: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "output/vcd" struct context { int num_enabled_probes; diff --git a/session.c b/session.c index 9130aa67..e1fb5cfb 100644 --- a/session.c +++ b/session.c @@ -25,14 +25,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "session: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "session" /** * @file diff --git a/session_driver.c b/session_driver.c index 5041092b..b023cbc0 100644 --- a/session_driver.c +++ b/session_driver.c @@ -26,14 +26,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "virtual-session: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "virtual-session" /* size of payloads sent across the session bus */ /** @cond PRIVATE */ diff --git a/session_file.c b/session_file.c index d720dd59..27e54095 100644 --- a/session_file.c +++ b/session_file.c @@ -30,14 +30,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "session-file: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "session-file" /** * @file diff --git a/std.c b/std.c index b6b6f6c7..727ee6e9 100644 --- a/std.c +++ b/std.c @@ -27,6 +27,8 @@ #include "libsigrok.h" #include "libsigrok-internal.h" +#define LOG_PREFIX "std" + /** * Standard sr_driver_init() API helper. * diff --git a/strutil.c b/strutil.c index f8644d72..40ffc4dc 100644 --- a/strutil.c +++ b/strutil.c @@ -25,14 +25,7 @@ #include "libsigrok.h" #include "libsigrok-internal.h" -/* Message logging helpers with subsystem-specific prefix string. */ -#define LOG_PREFIX "strutil: " -#define sr_log(l, s, args...) sr_log(l, LOG_PREFIX s, ## args) -#define sr_spew(s, args...) sr_spew(LOG_PREFIX s, ## args) -#define sr_dbg(s, args...) sr_dbg(LOG_PREFIX s, ## args) -#define sr_info(s, args...) sr_info(LOG_PREFIX s, ## args) -#define sr_warn(s, args...) sr_warn(LOG_PREFIX s, ## args) -#define sr_err(s, args...) sr_err(LOG_PREFIX s, ## args) +#define LOG_PREFIX "strutil" /** * @file