Skip to content

Commit 0a75413

Browse files
nokute78edsiper
authored andcommitted
proxy: use flb_error api
Signed-off-by: Takahiro Yamashita <[email protected]>
1 parent 676d1fa commit 0a75413

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/flb_plugin_proxy.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ static int flb_proxy_input_cb_init(struct flb_input_instance *ins,
141141
#endif
142142
}
143143
else {
144-
fprintf(stderr, "[proxy] unrecognized input proxy handler %i\n",
145-
pc->proxy->def->proxy);
144+
flb_error("[proxy] unrecognized input proxy handler %i",
145+
pc->proxy->def->proxy);
146146
}
147147

148148
/* Set the context */
@@ -367,8 +367,8 @@ int flb_plugin_proxy_output_init(struct flb_plugin_proxy *proxy,
367367
#endif
368368
}
369369
else {
370-
fprintf(stderr, "[proxy] unrecognized proxy handler %i\n",
371-
proxy->def->proxy);
370+
flb_error("[proxy] unrecognized proxy handler %i",
371+
proxy->def->proxy);
372372
}
373373

374374
return ret;
@@ -383,8 +383,8 @@ struct flb_plugin_proxy *flb_plugin_proxy_create(const char *dso_path, int type,
383383
/* Load shared library */
384384
handle = dlopen(dso_path, RTLD_LAZY);
385385
if (!handle) {
386-
fprintf(stderr, "[proxy] error opening plugin %s: '%s'\n",
387-
dso_path, dlerror());
386+
flb_error("[proxy] error opening plugin %s: '%s'",
387+
dso_path, dlerror());
388388
return NULL;
389389
}
390390

src/proxy/go/go.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ int proxy_go_output_register(struct flb_plugin_proxy *proxy,
7777

7878
plugin->cb_init = flb_plugin_proxy_symbol(proxy, "FLBPluginInit");
7979
if (!plugin->cb_init) {
80-
fprintf(stderr, "[go proxy]: could not load FLBPluginInit symbol\n");
80+
flb_error("[go proxy]: could not load FLBPluginInit symbol");
8181
flb_free(plugin);
8282
return -1;
8383
}
@@ -187,7 +187,7 @@ int proxy_go_input_register(struct flb_plugin_proxy *proxy,
187187

188188
plugin->cb_init = flb_plugin_proxy_symbol(proxy, "FLBPluginInit");
189189
if (!plugin->cb_init) {
190-
fprintf(stderr, "[go proxy]: could not load FLBPluginInit symbol\n");
190+
flb_error("[go proxy]: could not load FLBPluginInit symbol");
191191
flb_free(plugin);
192192
return -1;
193193
}

0 commit comments

Comments
 (0)