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.
This commit is contained in:
Uwe Hermann 2016-09-24 11:41:47 +02:00
parent cad447d21a
commit 7ade12b470
1 changed files with 3 additions and 2 deletions

View File

@ -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;
}