MCPcopy Create free account
hub / github.com/devspace-sh/devspace / ReadLogs

Method ReadLogs

pkg/devspace/kubectl/logs.go:12–24  ·  view source on GitHub ↗

ReadLogs reads the logs and returns a string

(ctx context.Context, namespace, podName, containerName string, lastContainerLog bool, tail *int64)

Source from the content-addressed store, hash-verified

10
11// ReadLogs reads the logs and returns a string
12func (client *client) ReadLogs(ctx context.Context, namespace, podName, containerName string, lastContainerLog bool, tail *int64) (string, error) {
13 readCloser, err := client.Logs(ctx, namespace, podName, containerName, lastContainerLog, tail, false)
14 if err != nil {
15 return "", err
16 }
17
18 logs, err := io.ReadAll(readCloser)
19 if err != nil {
20 return "", err
21 }
22
23 return string(logs), nil
24}
25
26// Logs prints the container logs
27func (client *client) Logs(ctx context.Context, namespace, podName, containerName string, lastContainerLog bool, tail *int64, follow bool) (io.ReadCloser, error) {

Callers

nothing calls this directly

Calls 1

LogsMethod · 0.95

Tested by

no test coverage detected