| 281 | } |
| 282 | |
| 283 | func (c *cli) allLogStreamsPickerOptions(ctx context.Context) (pickerOptions, error) { |
| 284 | logStreams, err := c.api.LogStream.List(ctx) |
| 285 | if err != nil { |
| 286 | return nil, fmt.Errorf("failed to list log streams: %w", err) |
| 287 | } |
| 288 | |
| 289 | var options pickerOptions |
| 290 | for _, logStream := range logStreams { |
| 291 | value := logStream.GetID() |
| 292 | label := fmt.Sprintf("%s %s", logStream.GetName(), ansi.Faint("("+value+")")) |
| 293 | options = append(options, pickerOption{value: value, label: label}) |
| 294 | } |
| 295 | |
| 296 | if len(options) == 0 { |
| 297 | return nil, errors.New("there are currently no log streams to choose from. Create one by running: `auth0 logs streams create`") |
| 298 | } |
| 299 | |
| 300 | return options, nil |
| 301 | } |
| 302 | |
| 303 | func (c *cli) logStreamPickerOptionsByType(desiredType logStreamType) pickerOptionsFunc { |
| 304 | return func(ctx context.Context) (pickerOptions, error) { |