github.com/nikandfor/tlog@v0.21.5-0.20231108111739-3ef89426a96d/examples/simplest/sub/sub.go (about)

     1  package sub
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/nikandfor/tlog"
     7  )
     8  
     9  func Func(ctx context.Context, i int) {
    10  	tr := tlog.SpawnFromContext(ctx, "sub_routine")
    11  	defer tr.Finish()
    12  
    13  	tr.Printf("sub.func: %d (traced)", i)
    14  }