Skip to content

Commit 2d4868d

Browse files
committed
Debug #49
Signed-off-by: jzajic <[email protected]>
1 parent cc418d9 commit 2d4868d

File tree

1 file changed

+10
-0
lines changed
  • examples/out_multiinstance

1 file changed

+10
-0
lines changed

examples/out_multiinstance/out.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212

1313
//export FLBPluginRegister
1414
func FLBPluginRegister(def unsafe.Pointer) int {
15+
log.Printf("[multiinstance] Register called")
1516
return output.FLBPluginRegister(def, "multiinstance", "Testing multiple instances.")
1617
}
1718

@@ -78,8 +79,17 @@ func FLBPluginExit() int {
7879

7980
//export FLBPluginExitCtx
8081
func FLBPluginExitCtx(ctx unsafe.Pointer) int {
82+
// Type assert context back into the original type for the Go variable
83+
id := output.FLBPluginGetContext(ctx).(string)
84+
log.Printf("[multiinstance] Exit called for id: %s", id)
8185
return output.FLB_OK
8286
}
8387

88+
//export FLBPluginUnregister
89+
func FLBPluginUnregister(def unsafe.Pointer) {
90+
log.Print("[multiinstance] Unregister called")
91+
output.FLBPluginUnregister(def)
92+
}
93+
8494
func main() {
8595
}

0 commit comments

Comments
 (0)