Centralise duplicated logging helper defines.

This commit is contained in:
Martin Ling 2013-12-23 03:38:35 +00:00 committed by Uwe Hermann
parent dafafb0e94
commit 3544f848e0
73 changed files with 83 additions and 549 deletions

View File

@ -23,6 +23,8 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
#define LOG_PREFIX "backend"
extern struct sr_session *session; extern struct sr_session *session;
/** /**

View File

@ -23,14 +23,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "device"
#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)
/** /**
* @file * @file

View File

@ -24,14 +24,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "filter"
#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)
/** /**
* @file * @file

View File

@ -20,14 +20,7 @@
#ifndef LIBSIGROK_HARDWARE_AGILENT_DMM_AGILENT_DMM_H #ifndef LIBSIGROK_HARDWARE_AGILENT_DMM_AGILENT_DMM_H
#define 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 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 AGDMM_BUFSIZE 256 #define AGDMM_BUFSIZE 256

View File

@ -28,14 +28,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "alsa"
#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)
/** Private, per-device-instance driver context. */ /** Private, per-device-instance driver context. */
struct dev_context { struct dev_context {

View File

@ -25,14 +25,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "appa-55ii"
#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 APPA_55II_NUM_PROBES 2 #define APPA_55II_NUM_PROBES 2
#define APPA_55II_BUF_SIZE (4 + 32 + 1) #define APPA_55II_BUF_SIZE (4 + 32 + 1)

View File

@ -22,14 +22,7 @@
#ifndef LIBSIGROK_HARDWARE_ASIX_SIGMA_ASIX_SIGMA_H #ifndef LIBSIGROK_HARDWARE_ASIX_SIGMA_ASIX_SIGMA_H
#define 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 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)
enum sigma_write_register { enum sigma_write_register {
WRITE_CLOCK_SELECT = 0, WRITE_CLOCK_SELECT = 0,

View File

@ -28,14 +28,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "brymen-dmm"
#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 DMM_BUFSIZE 256 #define DMM_BUFSIZE 256

View File

@ -25,14 +25,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "cem-dt-885x"
#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)
/* When retrieving samples from device memory, group this many /* When retrieving samples from device memory, group this many
* together into a sigrok packet. */ * together into a sigrok packet. */

View File

@ -29,14 +29,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "center-3xx"
#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)
/* Note: When adding entries here, don't forget to update CENTER_DEV_COUNT. */ /* Note: When adding entries here, don't forget to update CENTER_DEV_COUNT. */
enum { enum {

View File

@ -27,14 +27,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "la8"
#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 USB_VENDOR_ID 0x0403 #define USB_VENDOR_ID 0x0403
#define USB_DESCRIPTION "ChronoVu LA8" #define USB_DESCRIPTION "ChronoVu LA8"

View File

@ -24,14 +24,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "colead-slm"
#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)
enum { enum {
IDLE, IDLE,

View File

@ -31,14 +31,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "es51922"
#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)
/* Factors for the respective measurement mode (0 means "invalid"). */ /* Factors for the respective measurement mode (0 means "invalid"). */
static const float factors[8][8] = { static const float factors[8][8] = {

View File

@ -32,14 +32,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "es519xx"
#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)
/* Factors for the respective measurement mode (0 means "invalid"). */ /* Factors for the respective measurement mode (0 means "invalid"). */
static const float factors_2400_11b[8][8] = { static const float factors_2400_11b[8][8] = {

View File

@ -38,14 +38,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "fs9721"
#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)
static int parse_digit(uint8_t b) static int parse_digit(uint8_t b)
{ {

View File

@ -29,14 +29,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "fs9922"
#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)
static gboolean flags_valid(const struct fs9922_info *info) static gboolean flags_valid(const struct fs9922_info *info)
{ {

View File

@ -31,15 +31,6 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.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) SR_PRIV gboolean sr_m2110_packet_valid(const uint8_t *buf)
{ {
float val; float val;

View File

@ -34,14 +34,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "metex14"
#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)
static int parse_value(const uint8_t *buf, float *result) static int parse_value(const uint8_t *buf, float *result)
{ {

View File

@ -35,14 +35,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "rs91lcd"
#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)
/* Byte 1 of the packet, and the modes it represents */ /* Byte 1 of the packet, and the modes it represents */
#define IND1_HZ (1 << 7) #define IND1_HZ (1 << 7)

View File

@ -30,14 +30,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "ezusb"
#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)
SR_PRIV int ezusb_reset(struct libusb_device_handle *hdl, int set_clear) SR_PRIV int ezusb_reset(struct libusb_device_handle *hdl, int set_clear)
{ {

View File

@ -23,13 +23,7 @@
#include <glib.h> #include <glib.h>
#include <string.h> #include <string.h>
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "scpi"
#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 SCPI_READ_RETRIES 100 #define SCPI_READ_RETRIES 100
#define SCPI_READ_RETRY_TIMEOUT 10000 #define SCPI_READ_RETRY_TIMEOUT 10000

View File

@ -24,13 +24,7 @@
#include <glib.h> #include <glib.h>
#include <string.h> #include <string.h>
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "scpi_serial"
#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 SCPI_READ_RETRIES 100 #define SCPI_READ_RETRIES 100
#define SCPI_READ_RETRY_TIMEOUT 10000 #define SCPI_READ_RETRY_TIMEOUT 10000

View File

@ -37,13 +37,7 @@
#endif #endif
#include <errno.h> #include <errno.h>
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "scpi_tcp"
#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)
struct scpi_tcp { struct scpi_tcp {
char *address; char *address;

View File

@ -26,13 +26,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "scpi_usbtmc"
#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)
SR_PRIV int scpi_usbtmc_open(void *priv) SR_PRIV int scpi_usbtmc_open(void *priv)
{ {

View File

@ -26,14 +26,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "serial"
#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)
/** /**
* Open the specified serial port. * Open the specified serial port.

View File

@ -33,14 +33,7 @@
#define SUBCLASS_USBTMC 0x03 #define SUBCLASS_USBTMC 0x03
#define USBTMC_USB488 0x01 #define USBTMC_USB488 0x01
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "usb"
#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)
/** /**
* Find USB devices according to a connection string. * Find USB devices according to a connection string.

View File

@ -31,14 +31,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "demo"
#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)
/* TODO: Number of probes should be configurable. */ /* TODO: Number of probes should be configurable. */
#define NUM_PROBES 8 #define NUM_PROBES 8

View File

@ -20,14 +20,7 @@
#ifndef LIBSIGROK_HARDWARE_FLUKE_DMM_FLUKE_DMM_H #ifndef LIBSIGROK_HARDWARE_FLUKE_DMM_FLUKE_DMM_H
#define 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 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 FLUKEDMM_BUFSIZE 256 #define FLUKEDMM_BUFSIZE 256

View File

@ -29,14 +29,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "fx2lafw"
#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 USB_INTERFACE 0 #define USB_INTERFACE 0
#define USB_CONFIGURATION 1 #define USB_CONFIGURATION 1

View File

@ -25,14 +25,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "gmc-mh-1x-2x"
#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 GMC_BUFSIZE 266 #define GMC_BUFSIZE 266

View File

@ -26,14 +26,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "hameg-hmo"
#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 MAX_INSTRUMENT_VERSIONS 10 #define MAX_INSTRUMENT_VERSIONS 10
#define MAX_COMMAND_SIZE 31 #define MAX_COMMAND_SIZE 31

View File

@ -22,14 +22,7 @@
#ifndef LIBSIGROK_HARDWARE_HANTEK_DSO_DSO_H #ifndef LIBSIGROK_HARDWARE_HANTEK_DSO_DSO_H
#define 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 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 USB_INTERFACE 0 #define USB_INTERFACE 0
#define USB_CONFIGURATION 1 #define USB_CONFIGURATION 1

View File

@ -27,14 +27,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "ikalogic-scanalogic2"
#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 VENDOR_NAME "IKALOGIC" #define VENDOR_NAME "IKALOGIC"
#define MODEL_NAME "Scanalogic-2" #define MODEL_NAME "Scanalogic-2"

View File

@ -28,14 +28,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "scanaplus"
#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 COMPRESSED_BUF_SIZE (64 * 1024) #define COMPRESSED_BUF_SIZE (64 * 1024)

View File

@ -25,14 +25,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "kecheng-kc-330b"
#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 EP_IN 0x80 | 1 #define EP_IN 0x80 | 1
#define EP_OUT 2 #define EP_OUT 2

View File

@ -24,14 +24,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "lascar-el-usb"
#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 LASCAR_VENDOR "Lascar" #define LASCAR_VENDOR "Lascar"
#define LASCAR_INTERFACE 0 #define LASCAR_INTERFACE 0

View File

@ -29,14 +29,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "mso19"
#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 USB_VENDOR "3195" #define USB_VENDOR "3195"
#define USB_PRODUCT "f190" #define USB_PRODUCT "f190"

View File

@ -28,14 +28,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "mic-985xx"
#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)
/* Note: When adding entries here, don't forget to update MIC_DEV_COUNT. */ /* Note: When adding entries here, don't forget to update MIC_DEV_COUNT. */
enum { enum {

View File

@ -29,14 +29,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "norma-dmm"
#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 NMADMM_BUFSIZE 256 #define NMADMM_BUFSIZE 256

View File

@ -26,14 +26,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "ols"
#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 NUM_PROBES 32 #define NUM_PROBES 32
#define NUM_TRIGGER_STAGES 4 #define NUM_TRIGGER_STAGES 4

View File

@ -26,14 +26,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "rigol-ds"
#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 DS1000_ANALOG_LIVE_WAVEFORM_SIZE 600 #define DS1000_ANALOG_LIVE_WAVEFORM_SIZE 600
#define DS2000_ANALOG_LIVE_WAVEFORM_SIZE 1400 #define DS2000_ANALOG_LIVE_WAVEFORM_SIZE 1400

View File

@ -27,14 +27,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "saleae-logic16"
#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)
enum voltage_range { enum voltage_range {
VOLTAGE_RANGE_UNKNOWN, VOLTAGE_RANGE_UNKNOWN,

View File

@ -20,14 +20,7 @@
#ifndef LIBSIGROK_HARDWARE_SERIAL_DMM_PROTOCOL_H #ifndef LIBSIGROK_HARDWARE_SERIAL_DMM_PROTOCOL_H
#define 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 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)
/* Note: When adding entries here, don't forget to update DMM_COUNT. */ /* Note: When adding entries here, don't forget to update DMM_COUNT. */
enum { enum {

View File

@ -25,14 +25,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "teleinfo"
#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)
enum optarif { enum optarif {
OPTARIF_NONE, OPTARIF_NONE,

View File

@ -25,14 +25,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "tondaj-sl-814"
#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)
/** Private, per-device-instance driver context. */ /** Private, per-device-instance driver context. */
struct dev_context { struct dev_context {

View File

@ -27,14 +27,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "uni-t-dmm"
#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)
enum { enum {
TECPEL_DMM_8061, TECPEL_DMM_8061,

View File

@ -25,14 +25,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "uni-t-ut32x"
#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 DEFAULT_DATA_SOURCE DATA_SOURCE_LIVE #define DEFAULT_DATA_SOURCE DATA_SOURCE_LIVE
#define USB_CONN "1a86.e008" #define USB_CONN "1a86.e008"

View File

@ -24,14 +24,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "victor-dmm"
#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 DMM_DATA_SIZE 14 #define DMM_DATA_SIZE 14

View File

@ -28,14 +28,7 @@
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
#include "analyzer.h" #include "analyzer.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "zeroplus"
#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)
/* Private, per-device-instance driver context. */ /* Private, per-device-instance driver context. */
struct dev_context { struct dev_context {

View File

@ -27,14 +27,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "hwdriver"
#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)
/** /**
* @file * @file

View File

@ -26,14 +26,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "input/binary"
#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 CHUNKSIZE (512 * 1024) #define CHUNKSIZE (512 * 1024)
#define DEFAULT_NUM_PROBES 8 #define DEFAULT_NUM_PROBES 8

View File

@ -25,14 +25,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "input/chronovu-l8"
#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 NUM_PACKETS 2048 #define NUM_PACKETS 2048
#define PACKET_SIZE 4096 #define PACKET_SIZE 4096

View File

@ -23,14 +23,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "input/csv"
#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)
/* /*
* The CSV input module has the following options: * The CSV input module has the following options:

View File

@ -63,14 +63,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "input/vcd"
#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 DEFAULT_NUM_PROBES 8 #define DEFAULT_NUM_PROBES 8
#define CHUNKSIZE 1024 #define CHUNKSIZE 1024

View File

@ -25,14 +25,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "input/wav"
#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 CHUNK_SIZE 4096 #define CHUNK_SIZE 4096

View File

@ -162,6 +162,16 @@ SR_PRIV int sr_info(const char *format, ...);
SR_PRIV int sr_warn(const char *format, ...); SR_PRIV int sr_warn(const char *format, ...);
SR_PRIV int sr_err(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 --------------------------------------------------------------*/ /*--- device.c --------------------------------------------------------------*/
SR_PRIV struct sr_probe *sr_probe_new(int index, int type, SR_PRIV struct sr_probe *sr_probe_new(int index, int type,

1
log.c
View File

@ -21,6 +21,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include "libsigrok.h" #include "libsigrok.h"
#define NO_LOG_WRAPPERS
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/** /**

View File

@ -24,14 +24,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "output/analog"
#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)
struct context { struct context {
int num_enabled_probes; int num_enabled_probes;

View File

@ -24,14 +24,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "output/binary:"
#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)
static int data(struct sr_output *o, const uint8_t *data_in, static int data(struct sr_output *o, const uint8_t *data_in,
uint64_t length_in, uint8_t **data_out, uint64_t *length_out) uint64_t length_in, uint8_t **data_out, uint64_t *length_out)

View File

@ -24,14 +24,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "output/chronovu-la8"
#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)
struct context { struct context {
unsigned int num_enabled_probes; unsigned int num_enabled_probes;

View File

@ -25,14 +25,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "output/csv"
#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)
struct context { struct context {
unsigned int num_enabled_probes; unsigned int num_enabled_probes;

View File

@ -25,14 +25,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "output/gnuplot"
#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)
struct context { struct context {
unsigned int num_enabled_probes; unsigned int num_enabled_probes;

View File

@ -31,14 +31,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "output/ols"
#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)
struct context { struct context {
uint64_t samplerate; uint64_t samplerate;

View File

@ -25,14 +25,7 @@
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
#include "text.h" #include "text.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "output/ascii"
#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)
SR_PRIV int init_ascii(struct sr_output *o) SR_PRIV int init_ascii(struct sr_output *o)
{ {

View File

@ -25,14 +25,7 @@
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
#include "text.h" #include "text.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "output/bits"
#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)
SR_PRIV int init_bits(struct sr_output *o) SR_PRIV int init_bits(struct sr_output *o)
{ {

View File

@ -25,14 +25,7 @@
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
#include "text.h" #include "text.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "output/hex"
#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)
SR_PRIV int init_hex(struct sr_output *o) SR_PRIV int init_hex(struct sr_output *o)
{ {

View File

@ -27,14 +27,7 @@
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
#include "text.h" #include "text.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "output/text"
#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)
SR_PRIV void flush_linebufs(struct context *ctx, uint8_t *outbuf) SR_PRIV void flush_linebufs(struct context *ctx, uint8_t *outbuf)
{ {

View File

@ -26,14 +26,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "output/vcd"
#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)
struct context { struct context {
int num_enabled_probes; int num_enabled_probes;

View File

@ -25,14 +25,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "session"
#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)
/** /**
* @file * @file

View File

@ -26,14 +26,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "virtual-session"
#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)
/* size of payloads sent across the session bus */ /* size of payloads sent across the session bus */
/** @cond PRIVATE */ /** @cond PRIVATE */

View File

@ -30,14 +30,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "session-file"
#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)
/** /**
* @file * @file

2
std.c
View File

@ -27,6 +27,8 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
#define LOG_PREFIX "std"
/** /**
* Standard sr_driver_init() API helper. * Standard sr_driver_init() API helper.
* *

View File

@ -25,14 +25,7 @@
#include "libsigrok.h" #include "libsigrok.h"
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
/* Message logging helpers with subsystem-specific prefix string. */ #define LOG_PREFIX "strutil"
#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)
/** /**
* @file * @file