Expand debug to contain more than 31 cases

Scott Kostyshak skostysh at lyx.org
Tue Apr 19 01:22:41 UTC 2022


On Mon, Apr 18, 2022 at 12:21:40PM +0200, Kornel Benko wrote:
> The output while debugging findadv is overwhelming, but sometimes
> one needs only a small subset. Therefore the addition of -dbg findshort.
> 
> Also it would be possible to use constructions like
> 	LYXERR(Debug::FIND|Debug::FINDSHORT, "Setting regexp to : '" << regexp_str << "'")
> (mark the '|' in 'Debug::FIND|Debug::FINDSHORT' parameter)
> 
> The changes to lyxfind.cpp are also attached.
> 
> OK to commit?

I'm surprised this hasn't come up with a different context.

Would it make sense to have a more general mechanism? For example,
instead of find vs. findshort, what if we instead use --verbose ?  We do
currently have a "--verbose" but what I mean is to change "--verbose" to
accept a "<level>" argument that determines how verbose the debug output
is. So this way, "lyx --debug find --verbose 1" would give the same
output as "FIND", and "lyx --debug find --verbose 2" would give the same
output as "FINDSHORT".

I am not opposed to the patch, but if we do this for other debug flags,
and if we then decide to add e.g. 'FINDMEDIUM' it can get complicated.
But on the other hand, you are the first to propose this at least since
I've been here I think, so perhaps it is indeed a "one-off" and your
patch of "FIND" and "FINDSHORT" are better than implemening a general
mechanism that not many will use. Indeed, I would not argue against
"Advanced find" being a tricky beast that needs a special treatment.
Thank you for tackling this beast, by the way.

We can always add a more general mechanism later (i.e., even if you
commit your patch) if there is interest. It's not like this is a LyX
fileformat change where once something is in it can be annoying to
change.

I propose that if no one else responds, you commit your patch.

Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20220418/2e9a5edc/attachment.asc>


More information about the lyx-devel mailing list