static const char *config_keys[] = {"LogLevel", "File", "Timestamp",
"PrintSeverity"};
static const char *config_keys[] = {"LogLevel", "File", "Timestamp",
"PrintSeverity"};
static void logfile_print(const char *msg, int severity,
cdtime_t timestamp_time) {
FILE *fh;
static void logfile_print(const char *msg, int severity,
cdtime_t timestamp_time) {
FILE *fh;
fprintf(stderr, "logfile plugin: fopen (%s) failed: %s\n", log_file,
fprintf(stderr, "logfile plugin: fopen (%s) failed: %s\n", log_file,
} else {
if (print_timestamp)
fprintf(fh, "[%s] %s%s\n", timestamp_str, level_str, msg);
} else {
if (print_timestamp)
fprintf(fh, "[%s] %s%s\n", timestamp_str, level_str, msg);
#define APPEND(bufptr, buflen, key, value) \
if ((buflen > 0) && (strlen(value) > 0)) { \
#define APPEND(bufptr, buflen, key, value) \
if ((buflen > 0) && (strlen(value) > 0)) { \
- status = snprintf(bufptr, buflen, ", %s = %s", key, value); \
+ status = snprintf(bufptr, buflen, ", %s = %s", key, value); \