From 9eadda13b2769aca0fe636185a5eec5fd9f721a6 Mon Sep 17 00:00:00 2001 From: jzajic Date: Mon, 28 Nov 2022 09:57:43 +0100 Subject: [PATCH] Debug https://github.com/fluent/fluent-bit-go/issues/49 Signed-off-by: jzajic --- examples/out_multiinstance/out.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/examples/out_multiinstance/out.go b/examples/out_multiinstance/out.go index 12c0939..602c912 100644 --- a/examples/out_multiinstance/out.go +++ b/examples/out_multiinstance/out.go @@ -12,6 +12,7 @@ import ( //export FLBPluginRegister func FLBPluginRegister(def unsafe.Pointer) int { + log.Printf("[multiinstance] Register called") return output.FLBPluginRegister(def, "multiinstance", "Testing multiple instances.") } @@ -78,8 +79,18 @@ func FLBPluginExit() int { //export FLBPluginExitCtx func FLBPluginExitCtx(ctx unsafe.Pointer) int { + // Type assert context back into the original type for the Go variable + id := output.FLBPluginGetContext(ctx).(string) + log.Print("[multiinstance] Exit called for id: %s", id) return output.FLB_OK } +//export FLBPluginUnregister +// Release resources allocated by the plugin initialization +func FLBPluginUnregister(def unsafe.Pointer) { + log.Printf("[multiinstance] Unregister called") + output.FLBPluginUnregister(def) +} + func main() { }