mirror of
https://gitee.com/johng/gf
synced 2026-07-08 14:39:50 +08:00
15 lines
288 B
Go
15 lines
288 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"github.com/gogf/gf/os/glog"
|
|
)
|
|
|
|
func main() {
|
|
glog.SetCtxKeys("Trace-Id", "Span-Id", "Test")
|
|
ctx := context.WithValue(context.Background(), "Trace-Id", "1234567890")
|
|
ctx = context.WithValue(ctx, "Span-Id", "abcdefg")
|
|
|
|
glog.Ctx(ctx).Print(1, 2, 3)
|
|
}
|