* set_debug_options --- apply "-d N" command line option * * -d is not quite the same as setting log_min_messages because it enables * other output options. */
| 4554 | * other output options. |
| 4555 | */ |
| 4556 | void |
| 4557 | set_debug_options(int debug_flag, GucContext context, GucSource source) |
| 4558 | { |
| 4559 | if (debug_flag > 0) |
| 4560 | { |
| 4561 | char debugstr[64]; |
| 4562 | |
| 4563 | sprintf(debugstr, "debug%d", debug_flag); |
| 4564 | SetConfigOption("log_min_messages", debugstr, context, source); |
| 4565 | } |
| 4566 | else |
| 4567 | SetConfigOption("log_min_messages", "notice", context, source); |
| 4568 | |
| 4569 | if (debug_flag >= 1 && context == PGC_POSTMASTER) |
| 4570 | { |
| 4571 | SetConfigOption("log_connections", "true", context, source); |
| 4572 | SetConfigOption("log_disconnections", "true", context, source); |
| 4573 | } |
| 4574 | if (debug_flag >= 2) |
| 4575 | SetConfigOption("log_statement", "all", context, source); |
| 4576 | if (debug_flag >= 3) |
| 4577 | SetConfigOption("debug_print_parse", "true", context, source); |
| 4578 | if (debug_flag >= 4) |
| 4579 | SetConfigOption("debug_print_plan", "true", context, source); |
| 4580 | if (debug_flag >= 5) |
| 4581 | SetConfigOption("debug_print_rewritten", "true", context, source); |
| 4582 | } |
| 4583 | |
| 4584 | |
| 4585 | bool |
no test coverage detected