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])) } }
func main() { ctx := slog.Context{} ctx.Add("fixture", true) fmt.Println(ctx) }
func LogWithContext(ctx slog.Context) { ctx.Add("app", "lumbermill") log.Println(ctx) }