(ctx context.Context, rep repo.DirectRepository)
| 25 | } |
| 26 | |
| 27 | func (c *commandLogsList) run(ctx context.Context, rep repo.DirectRepository) error { |
| 28 | allSessions0, err := getLogSessions(ctx, rep.BlobReader()) |
| 29 | if err != nil { |
| 30 | return errors.Wrap(err, "error getting log sessions") |
| 31 | } |
| 32 | |
| 33 | allSessions := c.crit.filterLogSessions(allSessions0) |
| 34 | |
| 35 | if len(allSessions) < len(allSessions0) { |
| 36 | defer log(ctx).Infof("NOTE: Listed %v/%v log sessions, pass --all to show all.", len(allSessions), len(allSessions0)) |
| 37 | } |
| 38 | |
| 39 | // output sessions |
| 40 | for _, s := range allSessions { |
| 41 | c.out.printStdout( |
| 42 | "%v %v %v %v %v\n", s.id, |
| 43 | formatTimestamp(s.startTime), |
| 44 | s.endTime.Sub(s.startTime), |
| 45 | units.BytesString(s.totalSize), |
| 46 | len(s.segments), |
| 47 | ) |
| 48 | } |
| 49 | |
| 50 | return nil |
| 51 | } |
nothing calls this directly
no test coverage detected