Skip to content

Commit

Permalink
plugin_proxy: api: Expose log functions into Golang interface
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 committed Jul 4, 2022
1 parent 2d1c73a commit 36ff526
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/fluent-bit/flb_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ struct flb_api {

void *(*output_get_cmt_instance) (struct flb_output_instance *);
void *(*input_get_cmt_instance) (struct flb_input_instance *);

void (*log_print) (int, const char*, int, const char*, ...);
int (*log_check) (int);
};

#ifdef FLB_CORE
Expand Down
4 changes: 4 additions & 0 deletions src/flb_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <fluent-bit/flb_info.h>
#include <fluent-bit/flb_api.h>
#include <fluent-bit/flb_mem.h>
#include <fluent-bit/flb_log.h>

#include <fluent-bit/flb_input.h>
#include <fluent-bit/flb_output.h>
Expand All @@ -42,6 +43,9 @@ struct flb_api *flb_api_create()
api->input_get_cmt_instance = flb_input_get_cmt_instance;
#endif

api->log_print = flb_log_print;
api->log_check = flb_log_check;

return api;
}

Expand Down

0 comments on commit 36ff526

Please sign in to comment.