Commit 7b39f488 authored by Magnus Hagander's avatar Magnus Hagander

Split apart message_level_options into one set for server-side settings and

one for client-side, restoring the previous behaviour with different
sort order for the 'log' level. Also, remove redundant list of available
options, since the enum code will output it automatically.
parent 8c3340fe
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>. * Written by Peter Eisentraut <peter_e@gmx.net>.
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.458 2008/06/30 22:10:43 momjian Exp $ * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.459 2008/07/01 06:08:31 mha Exp $
* *
*-------------------------------------------------------------------- *--------------------------------------------------------------------
*/ */
...@@ -172,7 +172,12 @@ static char *config_enum_get_options(struct config_enum *record, ...@@ -172,7 +172,12 @@ static char *config_enum_get_options(struct config_enum *record,
/* /*
* Options for enum values defined in this module. * Options for enum values defined in this module.
*/ */
static const struct config_enum_entry message_level_options[] = {
/*
* We have different sets for client and server message level options because
* they sort slightly different (see "log" level)
*/
static const struct config_enum_entry client_message_level_options[] = {
{"debug", DEBUG2, false}, {"debug", DEBUG2, false},
{"debug5", DEBUG5, false}, {"debug5", DEBUG5, false},
{"debug4", DEBUG4, false}, {"debug4", DEBUG4, false},
...@@ -180,10 +185,27 @@ static const struct config_enum_entry message_level_options[] = { ...@@ -180,10 +185,27 @@ static const struct config_enum_entry message_level_options[] = {
{"debug2", DEBUG2, false}, {"debug2", DEBUG2, false},
{"debug1", DEBUG1, false}, {"debug1", DEBUG1, false},
{"log", LOG, false}, {"log", LOG, false},
{"info", INFO, true},
{"notice", NOTICE, false},
{"warning", WARNING, false},
{"error", ERROR, false},
{"fatal", FATAL, true},
{"panic", PANIC, true},
{NULL, 0, false}
};
static const struct config_enum_entry server_message_level_options[] = {
{"debug", DEBUG2, false},
{"debug5", DEBUG5, false},
{"debug4", DEBUG4, false},
{"debug3", DEBUG3, false},
{"debug2", DEBUG2, false},
{"debug1", DEBUG1, false},
{"info", INFO, false}, {"info", INFO, false},
{"notice", NOTICE, false}, {"notice", NOTICE, false},
{"warning", WARNING, false}, {"warning", WARNING, false},
{"error", ERROR, false}, {"error", ERROR, false},
{"log", LOG, false},
{"fatal", FATAL, false}, {"fatal", FATAL, false},
{"panic", PANIC, false}, {"panic", PANIC, false},
{NULL, 0, false} {NULL, 0, false}
...@@ -2449,13 +2471,11 @@ static struct config_enum ConfigureNamesEnum[] = ...@@ -2449,13 +2471,11 @@ static struct config_enum ConfigureNamesEnum[] =
{ {
{"client_min_messages", PGC_USERSET, LOGGING_WHEN, {"client_min_messages", PGC_USERSET, LOGGING_WHEN,
gettext_noop("Sets the message levels that are sent to the client."), gettext_noop("Sets the message levels that are sent to the client."),
gettext_noop("Valid values are DEBUG5, DEBUG4, DEBUG3, DEBUG2, " gettext_noop("Each level includes all the levels that follow it. The later"
"DEBUG1, LOG, NOTICE, WARNING, and ERROR. Each level includes all the " " the level, the fewer messages are sent.")
"levels that follow it. The later the level, the fewer messages are "
"sent.")
}, },
&client_min_messages, &client_min_messages,
NOTICE, message_level_options,NULL, NULL NOTICE, client_message_level_options,NULL, NULL
}, },
{ {
...@@ -2480,12 +2500,10 @@ static struct config_enum ConfigureNamesEnum[] = ...@@ -2480,12 +2500,10 @@ static struct config_enum ConfigureNamesEnum[] =
{ {
{"log_min_messages", PGC_SUSET, LOGGING_WHEN, {"log_min_messages", PGC_SUSET, LOGGING_WHEN,
gettext_noop("Sets the message levels that are logged."), gettext_noop("Sets the message levels that are logged."),
gettext_noop("Valid values are DEBUG5, DEBUG4, DEBUG3, DEBUG2, DEBUG1, " gettext_noop("Each level includes all levels that follow it.")
"INFO, NOTICE, WARNING, ERROR, LOG, FATAL, and PANIC. Each level "
"includes all the levels that follow it.")
}, },
&log_min_messages, &log_min_messages,
WARNING, message_level_options, NULL, NULL WARNING, server_message_level_options, NULL, NULL
}, },
{ {
...@@ -2495,7 +2513,7 @@ static struct config_enum ConfigureNamesEnum[] = ...@@ -2495,7 +2513,7 @@ static struct config_enum ConfigureNamesEnum[] =
"specified level or a higher level are logged.") "specified level or a higher level are logged.")
}, },
&log_min_error_statement, &log_min_error_statement,
ERROR, message_level_options, NULL, NULL ERROR, server_message_level_options, NULL, NULL
}, },
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment