ExampleNewLogHandler demonstrates using NewLogHandler for more control.
()
| 26 | |
| 27 | // ExampleNewLogHandler demonstrates using NewLogHandler for more control. |
| 28 | func ExampleNewLogHandler() { |
| 29 | // Set up the Lambda-aware slog handler |
| 30 | slog.SetDefault(slog.New(lambdacontext.NewLogHandler())) |
| 31 | |
| 32 | lambda.Start(func(ctx context.Context) (string, error) { |
| 33 | slog.InfoContext(ctx, "processing request", "action", "example") |
| 34 | return "success", nil |
| 35 | }) |
| 36 | } |
| 37 | |
| 38 | // ExampleNewLogHandler_withOptions demonstrates NewLogHandler with additional fields. |
| 39 | // Use WithFunctionARN() and WithTenantID() to include extra context. |
nothing calls this directly
no test coverage detected
searching dependent graphs…