mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 00:26:30 +00:00
Add log_detail() method
This commit is contained in:
16
log.c
16
log.c
@@ -71,7 +71,7 @@ _stderr_log_with_level(const char *level_name, int level, const char *fmt, va_li
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Store the requested level so that if there's a subsequent
|
* Store the requested level so that if there's a subsequent
|
||||||
* log_hint(), we can suppress that if appropriate.
|
* log_hint() or log_detail(), we can suppress that if appropriate.
|
||||||
*/
|
*/
|
||||||
last_log_level = level;
|
last_log_level = level;
|
||||||
|
|
||||||
@@ -113,6 +113,20 @@ log_hint(const char *fmt, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
log_detail(const char *fmt, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
|
if (terse_logging == false)
|
||||||
|
{
|
||||||
|
va_start(ap, fmt);
|
||||||
|
_stderr_log_with_level("DETAIL", last_log_level, fmt, ap);
|
||||||
|
va_end(ap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
log_verbose(int level, const char *fmt, ...)
|
log_verbose(int level, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
|
|||||||
2
log.h
2
log.h
@@ -126,6 +126,8 @@ bool logger_shutdown(void);
|
|||||||
void logger_set_verbose(void);
|
void logger_set_verbose(void);
|
||||||
void logger_set_terse(void);
|
void logger_set_terse(void);
|
||||||
|
|
||||||
|
void log_detail(const char *fmt, ...)
|
||||||
|
__attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2)));
|
||||||
void log_hint(const char *fmt, ...)
|
void log_hint(const char *fmt, ...)
|
||||||
__attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2)));
|
__attribute__((format(PG_PRINTF_ATTRIBUTE, 1, 2)));
|
||||||
void log_verbose(int level, const char *fmt, ...)
|
void log_verbose(int level, const char *fmt, ...)
|
||||||
|
|||||||
3
repmgr.c
3
repmgr.c
@@ -220,7 +220,7 @@ main(int argc, char **argv)
|
|||||||
{"rsync-only", no_argument, NULL, 'r'},
|
{"rsync-only", no_argument, NULL, 'r'},
|
||||||
{"fast-checkpoint", no_argument, NULL, 'c'},
|
{"fast-checkpoint", no_argument, NULL, 'c'},
|
||||||
{"log-level", required_argument, NULL, 'L'},
|
{"log-level", required_argument, NULL, 'L'},
|
||||||
{"terse", required_argument, NULL, 't'},
|
{"terse", no_argument, NULL, 't'},
|
||||||
{"mode", required_argument, NULL, 'm'},
|
{"mode", required_argument, NULL, 'm'},
|
||||||
{"remote-config-file", required_argument, NULL, 'C'},
|
{"remote-config-file", required_argument, NULL, 'C'},
|
||||||
{"help", no_argument, NULL, OPT_HELP},
|
{"help", no_argument, NULL, OPT_HELP},
|
||||||
@@ -877,7 +877,6 @@ main(int argc, char **argv)
|
|||||||
if (runtime_options.terse)
|
if (runtime_options.terse)
|
||||||
logger_set_terse();
|
logger_set_terse();
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Node configuration information is not needed for all actions, with
|
* Node configuration information is not needed for all actions, with
|
||||||
* STANDBY CLONE being the main exception.
|
* STANDBY CLONE being the main exception.
|
||||||
|
|||||||
Reference in New Issue
Block a user