summaryrefslogtreecommitdiff
path: root/src/backend/utils/error/elog.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-08-19 22:55:10 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-08-19 22:55:10 +0000
commitf333f69d1919399e07a08d06f4bb7ffc5fae49b6 (patch)
tree30b4f0988098d5b2a53bd2c9f275aae9769f57e0 /src/backend/utils/error/elog.c
parent4a1989ffd5bb7c93c7ccf860061a5142d5935268 (diff)
Bring some sanity to the trace_recovery_messages code and docs.
Per gripe from Fujii Masao, though this is not exactly his proposed patch. Categorize as DEVELOPER_OPTIONS and set context PGC_SIGHUP, as per Fujii, but set the default to LOG because higher values aren't really sensible (see the code for trace_recovery()). Fix the documentation to agree with the code and to try to explain what the variable actually does. Get rid of no-op calls trace_recovery(LOG), which accomplish nothing except to demonstrate that this option confuses even its author.
Diffstat (limited to 'src/backend/utils/error/elog.c')
-rw-r--r--src/backend/utils/error/elog.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index 2cafc31b2cd..feb0bd51fc9 100644
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -42,7 +42,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.224.2.1 2010/07/18 23:43:37 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.224.2.2 2010/08/19 22:55:10 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2798,12 +2798,19 @@ is_log_level_output(int elevel, int log_min_level)
}
/*
- * If trace_recovery_messages is set to make this visible, then show as LOG,
- * else display as whatever level is set. It may still be shown, but only
- * if log_min_messages is set lower than trace_recovery_messages.
+ * Adjust the level of a recovery-related message per trace_recovery_messages.
+ *
+ * The argument is the default log level of the message, eg, DEBUG2. (This
+ * should only be applied to DEBUGn log messages, otherwise it's a no-op.)
+ * If the level is >= trace_recovery_messages, we return LOG, causing the
+ * message to be logged unconditionally (for most settings of
+ * log_min_messages). Otherwise, we return the argument unchanged.
+ * The message will then be shown based on the setting of log_min_messages.
*
* Intention is to keep this for at least the whole of the 9.0 production
* release, so we can more easily diagnose production problems in the field.
+ * It should go away eventually, though, because it's an ugly and
+ * hard-to-explain kluge.
*/
int
trace_recovery(int trace_level)