MCPcopy
hub / github.com/kopia/kopia / run

Method run

cli/command_logs_list.go:27–51  ·  view source on GitHub ↗
(ctx context.Context, rep repo.DirectRepository)

Source from the content-addressed store, hash-verified

25}
26
27func (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}

Callers

nothing calls this directly

Calls 7

BytesStringFunction · 0.92
getLogSessionsFunction · 0.85
formatTimestampFunction · 0.85
filterLogSessionsMethod · 0.80
printStdoutMethod · 0.80
SubMethod · 0.80
BlobReaderMethod · 0.65

Tested by

no test coverage detected