Add log_hint() function for logging hints

There are a few places where additional hints are written as log
output, usually LOG_NOTICE. Create an explicit function to provide
hints in a standardized manner; by storing the log level of the
previous logger call, we can ensure the hint is only displayed when
the log message itself would be.

Part of an ongoing effort to better control repmgr's logging output.
This commit is contained in:
Ian Barwick
2015-11-13 14:29:11 +09:00
parent ea01d1d30b
commit ae84041a4e
4 changed files with 30 additions and 11 deletions

3
log.h
View File

@@ -115,10 +115,11 @@ __attribute__((format(PG_PRINTF_ATTRIBUTE, 3, 4)));
/* Logger initialisation and shutdown */
bool logger_shutdown(void);
bool logger_init(t_configuration_options * opts, const char *ident,
bool logger_init(t_configuration_options * opts, const char *ident,
const char *level, const char *facility);
void logger_min_verbose(int minimum);
void log_hint(const char *fmt, ...);
extern int log_type;
extern int log_level;