Opened 11 years ago

Closed 9 years ago

#2287 closed defect (fixed)

--enable-debug builds are way too verbose

Reported by: alvherre Owned by: pramsey
Priority: high Milestone: PostGIS 2.2.0
Component: postgis Version: master
Keywords: Cc:

Description

We were debugging a crash on a customer (which turned out to be stack overflow in libgeos, apparently fixed in geos revs 3711 and 3751) and noticed that when running with —enable-debug enabled, there are some macros which cause too much output: the debug messages are emitted at level NOTICE, so it's fairly difficult to silence them. This has been mentioned in the mailing list as causing problems for the regression tests: http://lists.osgeo.org/pipermail/postgis-devel/2010-February/008742.html

It seems to me that it'd be more useful to emit the messages in DEBUGx level instead of NOTICE, where the "x" depends on the verbosity specified by the debugging call itself; so for example a POSTGIS_DEBUG(1) call would be emitted as DEBUG1 and so on.

One (simple to resolve) problem is that there are several such macros. Not only there's POSTGIS_DEBUG, but there's also RASTER_DEBUG and POSTGIS_RT_DEBUG, and their "..F" counterparts. Probably, they should all be tweaked in much the same way. But there's one that's a bit more problematic —- LW_DEBUG. That one calls lwnotice() instead, which is a configurable notice printer.

Is there a consensus on how to deal with this? With some guidance, I can try to address the problem and propose a patch.

Change History (5)

comment:1 by robe, 11 years ago

Milestone: PostGIS 2.1.0

comment:2 by robe, 11 years ago

Milestone: PostGIS 2.1.0PostGIS 2.2.0

still none.

comment:3 by pramsey, 9 years ago

Priority: mediumhigh

comment:4 by pramsey, 9 years ago

OK, I don't see any cute trick to avoid just adding a debug handler to liblwgeom, since there are clearly different levels of usage coming out of the library: optional debug info, notice info you really want surfaced, and errors.

comment:5 by pramsey, 9 years ago

Resolution: fixed
Status: newclosed

OK, moved debug messages into the DEBUG channel so they can be turned up or down using client_min_messages. You still only get as many messages as you build for, and all debugging is still macro'ed off for any level < 1. At r13617.

Note: See TracTickets for help on using tickets.