Пример #1
0
func (g *ChanGroup) Sample(ctx slog.Context) {
	ctx.Add("source", g.Name)
	for i := 0; i < numSeries; i++ {
		// TODO: If we set the ChanGroup.Name to be the hostname, this might need to change.
		ctx.Sample(fmt.Sprintf("points.%s.pending", seriesNames[i]), len(g.points[i]))
	}
}
Пример #2
0
func main() {
	ctx := slog.Context{}
	ctx.Add("fixture", true)
	fmt.Println(ctx)
}
Пример #3
0
func LogWithContext(ctx slog.Context) {
	ctx.Add("app", "lumbermill")
	log.Println(ctx)
}