Skip to content

Commit

Permalink
Debug fluent#49
Browse files Browse the repository at this point in the history
Signed-off-by: jzajic <[email protected]>
  • Loading branch information
jan-zajic committed Nov 28, 2022
1 parent cc418d9 commit 2d4868d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions examples/out_multiinstance/out.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
}

Expand Down Expand Up @@ -78,8 +79,17 @@ 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.Printf("[multiinstance] Exit called for id: %s", id)
return output.FLB_OK
}

//export FLBPluginUnregister
func FLBPluginUnregister(def unsafe.Pointer) {
log.Print("[multiinstance] Unregister called")
output.FLBPluginUnregister(def)
}

func main() {
}

0 comments on commit 2d4868d

Please sign in to comment.