in_disk: use new input logging api
#include <fluent-bit/flb_info.h>
#include <fluent-bit/flb_input.h>
+#include <fluent-bit/flb_input_plugin.h>
#include <fluent-bit/flb_config.h>
#include <fluent-bit/flb_error.h>
#include <fluent-bit/flb_str.h>
@@ -78,7 +79,7 @@ static int update_disk_stats(struct flb_in_disk_config *ctx)
fp = fopen("/proc/diskstats", "r");
if (fp == NULL) {
- perror("fopen");
+ flb_errno();
return -1;
}
@@ -265,7 +266,7 @@ static int configure(struct flb_in_disk_config *disk_config,
disk_config->write_total == NULL ||
disk_config->prev_read_total == NULL ||
disk_config->prev_write_total == NULL) {
- flb_error("[in_disk] could not allocate memory");
+ flb_plg_error(in, "could not allocate memory");
return -1;
}
@@ -313,7 +314,7 @@ static int in_disk_init(struct flb_input_instance *in,
disk_config->interval_sec,
disk_config->interval_nsec, config);
if (ret < 0) {
- flb_error("could not set collector for disk input plugin");
+ flb_plg_error(in, "could not set collector for disk input plugin");
goto init_error;
}
