()
| 108 | } |
| 109 | |
| 110 | func ExampleLogger_Named() { |
| 111 | ctx := context.Background() |
| 112 | |
| 113 | l := slog.Make(sloghuman.Sink(os.Stdout)) |
| 114 | l = l.Named("http") |
| 115 | l.Info(ctx, "received request", slog.F("remote address", net.IPv4(127, 0, 0, 1))) |
| 116 | |
| 117 | // 2019-12-07 21:20:56.974 [INFO] (http) received request remote_address=127.0.0.1} |
| 118 | } |
| 119 | |
| 120 | func ExampleLogger_Leveled() { |
| 121 | ctx := context.Background() |