MCPcopy Create free account
hub / github.com/Scalingo/cli / Logs

Function Logs

db/logs.go:19–42  ·  view source on GitHub ↗

Logs displays the addon logs. app may be an app UUID or name. addon may be a addon UUID or an addon type (e.g. MongoDB).

(ctx context.Context, app, addonUUID string, opts LogsOpts)

Source from the content-addressed store, hash-verified

17// app may be an app UUID or name.
18// addon may be a addon UUID or an addon type (e.g. MongoDB).
19func Logs(ctx context.Context, app, addonUUID string, opts LogsOpts) error {
20 c, err := config.ScalingoClient(ctx)
21 if err != nil {
22 return errors.Wrapf(ctx, err, "fail to get Scalingo client")
23 }
24
25 url, err := c.AddonLogsURL(ctx, app, addonUUID)
26 if err != nil {
27 return errors.Wrapf(ctx, err, "fail to get log URL")
28 }
29
30 err = logs.Dump(ctx, url, opts.Count, "")
31 if err != nil {
32 return errors.Wrapf(ctx, err, "fail to dump logs")
33 }
34
35 if opts.Follow {
36 err := logs.Stream(ctx, url, "")
37 if err != nil {
38 return errors.Wrapf(ctx, err, "fail to stream logs")
39 }
40 }
41 return nil
42}

Callers 1

logs.goFile · 0.92

Calls 3

ScalingoClientFunction · 0.92
DumpFunction · 0.92
StreamFunction · 0.92

Tested by

no test coverage detected