@cryptotaxi247 / netdata-1 / commits / 0979ac0fb

convert some error messages to info (#16505)

Ilya Mashchenko committed Nov 30, 2023 at 00:22 UTC 0979ac0fb3831e19108aaa9b5a2f55aa4d6f24b4
4 files changed +21 -10
aclk/aclk.c
+6 -6
@@ -235,22 +235,22 @@ void aclk_mqtt_wss_log_cb(mqtt_wss_log_type_t log_type, const char* str)
235 switch(log_type) {
236 case MQTT_WSS_LOG_ERROR:
237 case MQTT_WSS_LOG_FATAL:
238 + nd_log(NDLS_DAEMON, NDLP_ERR, "%s", str);
239 + return;
240 +
241 case MQTT_WSS_LOG_WARN:
239 - error_report("%s", str);
242 + nd_log(NDLS_DAEMON, NDLP_WARNING, "%s", str);
243 return;
244
245 case MQTT_WSS_LOG_INFO:
243 - nd_log(NDLS_DAEMON, NDLP_INFO,
244 - "%s",
245 - str);
246 + nd_log(NDLS_DAEMON, NDLP_INFO, "%s", str);
247 return;
248
249 case MQTT_WSS_LOG_DEBUG:
250 return;
251
252 default:
252 - nd_log(NDLS_DAEMON, NDLP_ERR,
253 - "Unknown log type from mqtt_wss");
253 + nd_log(NDLS_DAEMON, NDLP_ERR, "Unknown log type from mqtt_wss");
254 }
255 }
256
collectors/proc.plugin/proc_diskstats.c
+4 -1
@@ -366,7 +366,10 @@ static inline int get_disk_name_from_path(const char *path, char *result, size_t
366
367 DIR *dir = opendir(path);
368 if (!dir) {
369 - collector_error("DEVICE-MAPPER ('%s', %lu:%lu): Cannot open directory '%s'.", disk, major, minor, path);
369 + if (errno == ENOENT)
370 + collector_info("DEVICE-MAPPER ('%s', %lu:%lu): Cannot open directory '%s'.", disk, major, minor, path);
371 + else
372 + collector_error("DEVICE-MAPPER ('%s', %lu:%lu): Cannot open directory '%s'.", disk, major, minor, path);
373 goto failed;
374 }
375
collectors/proc.plugin/proc_spl_kstat_zfs.c
+4 -1
@@ -335,7 +335,10 @@ int do_proc_spl_kstat_zfs_pool_state(int update_every, usec_t dt)
335 if (likely(do_zfs_pool_state)) {
336 DIR *dir = opendir(dirname);
337 if (unlikely(!dir)) {
338 - collector_error("Cannot read directory '%s'", dirname);
338 + if (errno == ENOENT)
339 + collector_info("Cannot read directory '%s'", dirname);
340 + else
341 + collector_error("Cannot read directory '%s'", dirname);
342 return 1;
343 }
344
libnetdata/procfile/procfile.c
+7 -2
@@ -407,9 +407,14 @@ procfile *procfile_open(const char *filename, const char *separators, uint32_t f
407
408 int fd = open(filename, procfile_open_flags, 0666);
409 if(unlikely(fd == -1)) {
410 - if(unlikely(!(flags & PROCFILE_FLAG_NO_ERROR_ON_FILE_IO))) collector_error(PF_PREFIX ": Cannot open file '%s'", filename);
411 - else if(unlikely(flags & PROCFILE_FLAG_ERROR_ON_ERROR_LOG))
410 + if (unlikely(flags & PROCFILE_FLAG_ERROR_ON_ERROR_LOG))
411 netdata_log_error(PF_PREFIX ": Cannot open file '%s'", filename);
412 + else if (unlikely(!(flags & PROCFILE_FLAG_NO_ERROR_ON_FILE_IO))) {
413 + if (errno == ENOENT)
414 + collector_info(PF_PREFIX ": Cannot open file '%s'", filename);
415 + else
416 + collector_error(PF_PREFIX ": Cannot open file '%s'", filename);
417 + }
418 return NULL;
419 }
420