Hi,
On Mon, May 14, 2001 at 10:16:35AM +0200, Petter Reinholdtsen wrote:
> I believe there is a misfeature in the DBG() functions. Peter Fales
> pointed out to me that the following code in a backend
>
> DBG(0, "foo");
>
> will print out "foo" even if SANE_DEBUG_BACKEND is not set. I believe
> this is wrong. I believe DBG() should not print anything unless
> debugging is enabled for that specific backend. I suggest applying
> this patch to fix it. Is there anything I haven't thought about?
I don't know if this was intentional but I like the current behaviour.
It should be clear that DBG(0,...) should be used with care and only
when the backend has detected a scanner that is supported (at least in
principle) by the backend. E.g. I'm using this in mustek.c to print a
warning when a scanner is used that nobody has tested yet but which is
a Mustek scanner.
So I'm voting for the old behaviour.
> The patch changes the default level to be (in practise, not in
> reality) -1, instead of the previous default level 0.
If I remeber correctly at least one backend (microtek?) uses the debug
level directly. So probably it will be confused about this.
Also the "[sanei_debug] Setting debug level ..." isn't printed any more.
Bye,
Henning
-- Source code, list archive, and docs: http://www.mostang.com/sane/ To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com
This archive was generated by hypermail 2b29 : Mon May 14 2001 - 11:04:27 PDT