Re: Allow auto_explain to log to NOTICE

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Dunstan <pgsql(at)tomd(dot)cc>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Allow auto_explain to log to NOTICE
Date: 2018-04-27 02:16:38
Message-ID: 20180427021638.bpk3e6gbqtredk2b@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2018-04-27 11:43:58 +0930, Tom Dunstan wrote:
> This patch allows a user to configure auto_explain to log to NOTICE instead
> of the server log. This allows automated testing of application-generated
> queries to ensure correct plans etc from code that can inspect returned
> notices but not the server log.

> I don't see any tests for auto_explain so haven't added any test cases.
> Happy to do so if that's deemed necessary.

I'd be in favor of adding them.

> +static int auto_explain_log_destination = LOG;

I very much dislike this name - it's too similar too the log_destination
GUC, while being about something different. How about "log_level"?

>
> +static const struct config_enum_entry destination_options[] = {
> + {"log", LOG, false},
> + {"notice", NOTICE, false},
> + {NULL, 0, false}
> +};

I'd argue this should contain the non-error cases. It's just as
reasonable to want to add this as a debug level or such.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Dunstan 2018-04-27 02:23:23 Re: Allow auto_explain to log to NOTICE
Previous Message Tom Dunstan 2018-04-27 02:13:58 Allow auto_explain to log to NOTICE