From: Uwe Hermann Date: Sat, 24 Sep 2016 09:41:47 +0000 (+0200) Subject: resource: Improve logging output. X-Git-Tag: libsigrok-0.5.0~216 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=7ade12b470366a03f7bf84e4989c9d3593dc333b;p=libsigrok.git resource: Improve logging output. Don't show duplicate lines (per default) such as sr: resource: Failed to locate 'saleae-logic16-fx2.fw'. sr: resource: Failed to open resource 'saleae-logic16-fx2.fw'. The first one is now an sr_dbg() instead of sr_err(). Also, mention that a higher loglevel will give more information as to where the backend is looking for resources / firmware files. This fixes bug #806. --- diff --git a/src/resource.c b/src/resource.c index c87e7be0..63415930 100644 --- a/src/resource.c +++ b/src/resource.c @@ -135,7 +135,7 @@ static int resource_open_default(struct sr_resource *res, file = try_open_file(*datadirs++, subdir, name); } if (!file) { - sr_err("Failed to locate '%s'.", name); + sr_dbg("Failed to locate '%s'.", name); return SR_ERR; } @@ -266,7 +266,8 @@ SR_PRIV int sr_resource_open(struct sr_context *ctx, ret = (*ctx->resource_open_cb)(res, name, ctx->resource_cb_data); if (ret != SR_OK) - sr_err("Failed to open resource '%s'.", name); + sr_err("Failed to open resource '%s' (use loglevel 5/spew for" + " details).", name); return ret; }