Questions about POSTGIS_DEBUG

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Questions about POSTGIS_DEBUG

Han Wang
Hi all,

Currently I am using `POSTGIS_DEBUG` in the /regress tests. But I haven't seen any debug output in console or regress logs. I would like to know where can I get these information?

Thanks for any answers or.suggestions.

Best regards,
Han

_______________________________________________
postgis-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-devel
Reply | Threaded
Open this post in threaded view
|

Re: Questions about POSTGIS_DEBUG

Han Wang
Hi Giuseppe,

Please forgive me if I was unclear.

I call `POSTGIS_DEBUG` in some functions to debug but when I run .sql test script in /regress folder, I did not see any output related to the debug information. Besides, I have already set the `POSTGIS_DEBUG_LEVEL` to 1.

Best regards,
Han

On Mon, Jun 14, 2021 at 8:37 PM Giuseppe Broccolo <[hidden email]> wrote:
Hi Han,

Il giorno lun 14 giu 2021 alle ore 12:30 Han Wang <[hidden email]> ha scritto:
Hi all,

Currently I am using `POSTGIS_DEBUG` in the /regress tests. But I haven't seen any debug output in console or regress logs. I would like to know where can I get these information?

postgis_debug should be a method used to log debug messages during the execution of C modules. What do you mean with "I am using `POSTGIS_DEBUG` in the /regress tests."?

Anyway, logging is configured at PostgreSQL level, did you eventually check also the PostgreSQL server's logs?

Giuseppe.
_______________________________________________
postgis-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-devel

_______________________________________________
postgis-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-devel
Reply | Threaded
Open this post in threaded view
|

Re: Questions about POSTGIS_DEBUG

Paul Ramsey-3
I have more-or-less totally stopped using POSTGIS_DEBUG for anything... during development I usually have some temporary elog() statements, and for things I want to keep around post-development that aren't going to generate too much data I just downgrade them to elog(debug) level. For day-to-day debugging on tickets and so on, for already released code I usually head straight for the debugger, don't turn on POSTGIS_DEBUG. I find turning it on just results in a firehose of output from non-related modules from which it's too much work to extract the parts I actually care about.

P.

> On Jun 14, 2021, at 6:41 AM, Han Wang <[hidden email]> wrote:
>
> Hi Giuseppe,
>
> Please forgive me if I was unclear.
>
> I call `POSTGIS_DEBUG` in some functions to debug but when I run .sql test script in /regress folder, I did not see any output related to the debug information. Besides, I have already set the `POSTGIS_DEBUG_LEVEL` to 1.
>
> Best regards,
> Han
>
> On Mon, Jun 14, 2021 at 8:37 PM Giuseppe Broccolo <[hidden email]> wrote:
> Hi Han,
>
> Il giorno lun 14 giu 2021 alle ore 12:30 Han Wang <[hidden email]> ha scritto:
> Hi all,
>
> Currently I am using `POSTGIS_DEBUG` in the /regress tests. But I haven't seen any debug output in console or regress logs. I would like to know where can I get these information?
>
> postgis_debug should be a method used to log debug messages during the execution of C modules. What do you mean with "I am using `POSTGIS_DEBUG` in the /regress tests."?
>
> Anyway, logging is configured at PostgreSQL level, did you eventually check also the PostgreSQL server's logs?
>
> Giuseppe.
> _______________________________________________
> postgis-devel mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/postgis-devel
> _______________________________________________
> postgis-devel mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/postgis-devel

_______________________________________________
postgis-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-devel
Reply | Threaded
Open this post in threaded view
|

Re: Questions about POSTGIS_DEBUG

Sandro Santilli-3
In reply to this post by Han Wang
On Mon, Jun 14, 2021 at 09:41:21PM +0800, Han Wang wrote:
> Hi Giuseppe,
>
> Please forgive me if I was unclear.
>
> I call `POSTGIS_DEBUG` in some functions to debug but when I run .sql test
> script in /regress folder, I did not see any output related to the debug
> information. Besides, I have already set the `*POSTGIS_DEBUG_LEVEL*` to *1*.

1) Did you add this to your sql :

   set client_min_messages to DEBUG;

2) How did you set POSTGIS_DEBUG_LEVEL ?

   The build scripts are not very robust so you you're doing
   this globally you may need to do a clean build.

I saw there's a postgis/DEBUG file which mentions the need for
a rebuild, if you find anything useful which is missing there
feel free to add it.

What I often do rather than setting the debug macro globally
is I redefined that in the .c file, making sure to do so
after postgis_config.h is included and before lwgeom_log.h
is included. You will find a commented-out such definition
in some files, for example in topology/postgis_topology.c

--strk;
_______________________________________________
postgis-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-devel
Reply | Threaded
Open this post in threaded view
|

Re: Questions about POSTGIS_DEBUG

Han Wang
Hi Paul and hi Sandro,

Thanks for your reply!

The `elog()` seems to work. Because of different log levels like `NOTICE` or `WARNING`, the log will not to send to server. And as Sandro said, I did not set client_min_messages explicitly, but now I set elog level to `NOTICE` and I can see some information in the regress test output. It basically works. Thank both of you for your help!

Best,
Han

On Tue, Jun 15, 2021 at 6:01 AM Sandro Santilli <[hidden email]> wrote:
On Mon, Jun 14, 2021 at 09:41:21PM +0800, Han Wang wrote:
> Hi Giuseppe,
>
> Please forgive me if I was unclear.
>
> I call `POSTGIS_DEBUG` in some functions to debug but when I run .sql test
> script in /regress folder, I did not see any output related to the debug
> information. Besides, I have already set the `*POSTGIS_DEBUG_LEVEL*` to *1*.

1) Did you add this to your sql :

   set client_min_messages to DEBUG;

2) How did you set POSTGIS_DEBUG_LEVEL ?

   The build scripts are not very robust so you you're doing
   this globally you may need to do a clean build.

I saw there's a postgis/DEBUG file which mentions the need for
a rebuild, if you find anything useful which is missing there
feel free to add it.

What I often do rather than setting the debug macro globally
is I redefined that in the .c file, making sure to do so
after postgis_config.h is included and before lwgeom_log.h
is included. You will find a commented-out such definition
in some files, for example in topology/postgis_topology.c

--strk;
_______________________________________________
postgis-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-devel

_______________________________________________
postgis-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-devel