libprom
@VERSION@
C based libraries to expose metrics in Promtheus exposition format
|
Go to the documentation of this file.
25 #ifdef PROM_LOG_ENABLE
89 #define PROM_LOG_PRIV(level, fmt, ...) \
90 prom_log(level, "%s:%d::%s(): " fmt , \
91 __FILE__, __LINE__, __func__, __VA_ARGS__);
97 #define PROM_DEBUG(fmt, ...) PROM_LOG_PRIV(PLL_DBG, fmt, __VA_ARGS__);
102 #define PROM_INFO(fmt, ...) PROM_LOG_PRIV(PLL_INFO, fmt, __VA_ARGS__);
107 #define PROM_WARN(fmt, ...) PROM_LOG_PRIV(PLL_WARN, fmt, __VA_ARGS__);
112 #define PROM_ERROR(fmt, ...) PROM_LOG_PRIV(PLL_ERR, fmt, __VA_ARGS__);
117 #define PROM_FATAL(fmt, ...) PROM_LOG_PRIV(PLL_FATAL, fmt, __VA_ARGS__);
122 #define PROM_LOG(msg) PROM_INFO("%s", msg);
126 #define PROM_DEBUG(fmt, ...)
127 #define PROM_INFO(fmt, ...)
128 #define PROM_WARN(fmt, ...)
129 #define PROM_ERROR(fmt, ...)
130 #define PROM_FATAL(fmt, ...)
131 #define PROM_LOG(msg)
133 #define prom_log(x, fmt, ...)
134 #define prom_log_level(x) 0
135 #define prom_log_level_parse(x) 0
136 #define prom_log_use(x) NULL
138 #endif // PROM_LOG_ENABLE
@ PLL_FATAL
fatal level
Definition: prom_log.h:38
@ PLL_INFO
info level
Definition: prom_log.h:35
@ PLL_WARN
warning level
Definition: prom_log.h:36
void prom_log(PROM_LOG_LEVEL level, const char *format,...)
If the given PROM_LOG_LEVEL is >= the log level set, generate and log a related message,...
FILE * prom_log_use(FILE *stream)
Use the given stream for logging.
@ PLL_NONE
placeholder for 0 - implies nothing.
Definition: prom_log.h:33
@ PLL_COUNT
number of log levels
Definition: prom_log.h:39
@ PLL_DBG
debug level
Definition: prom_log.h:34
PROM_LOG_LEVEL
Available log levels.
Definition: prom_log.h:32
@ PLL_ERR
error level
Definition: prom_log.h:37
PROM_LOG_LEVEL prom_log_level_parse(const char *level)
Parse the given log level name (for convenience, a single digit gets recognized as well) and return i...
PROM_LOG_LEVEL prom_log_level(PROM_LOG_LEVEL level)
Set the current log level.