Expand debug to contain more than 31 cases

Kornel Benko kornel at lyx.org
Tue Apr 19 08:08:56 UTC 2022


Am Mon, 18 Apr 2022 21:22:41 -0400
schrieb Scott Kostyshak <skostysh at lyx.org>:

> 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 ?

Good idea.

>  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".

Maybe the other way around. FIND -> FINDLONG, FINDSHORT -> FIND
so that --verbose 2 would select FINGLONG.

> 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.

Yes.

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

	Kornel

-- 
lyx-devel mailing list
lyx-devel at lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: Digitale Signatur von OpenPGP
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20220419/1c09ddca/attachment-0001.asc>


More information about the lyx-devel mailing list