lib: add support for aws customsized error reporting logger
#include <mcheck.h>
#endif
+#ifdef FLB_HAVE_AWS_ERROR_REPORTER
+#include <fluent-bit/aws/flb_aws_error_reporter.h>
+
+struct flb_aws_error_reporter *error_reporter;
+#endif
+
/* thread initializator */
static pthread_once_t flb_lib_once = PTHREAD_ONCE_INIT;
@@ -194,6 +200,12 @@ flb_ctx_t *flb_create()
return NULL;
}
+ #ifdef FLB_HAVE_AWS_ERROR_REPORTER
+ if (is_error_reporting_enabled()) {
+ error_reporter = flb_aws_error_reporter_create();
+ }
+ #endif
+
return ctx;
}
@@ -220,6 +232,12 @@ void flb_destroy(flb_ctx_t *ctx)
flb_config_exit(ctx->config);
}
+ #ifdef FLB_HAVE_AWS_ERROR_REPORTER
+ if (is_error_reporting_enabled()) {
+ flb_aws_error_reporter_destroy(error_reporter);
+ }
+ #endif
+
flb_free(ctx);
ctx = NULL;
