log

package
v2.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpLog

func DumpLog(ctx context.Context, client kubernetes.Interface, pod *corev1.Pod, podLogOpts corev1.PodLogOptions) (string, error)

DumpLog extract the full log from a Pod. Recommended when the quantity of log expected is minimum.

func Print

func Print(ctx context.Context, cmd *cobra.Command, client kubernetes.Interface, integration *v1.Integration, tailLines *int64, out io.Writer) error

Print prints integrations logs to the stdout.

func PrintUsingSelector

func PrintUsingSelector(ctx context.Context, cmd *cobra.Command, client kubernetes.Interface, namespace, defaultContainerName, selector string, tailLines *int64, out io.Writer) error

PrintUsingSelector prints pod logs using a selector.

Types

type PodScraper

type PodScraper struct {
	L klog.Logger
	// contains filtered or unexported fields
}

PodScraper scrapes logs of a specific pod.

func NewPodScraper

func NewPodScraper(c kubernetes.Interface, namespace string, podName string, defaultContainerName string, tailLines *int64) *PodScraper

NewPodScraper creates a new pod scraper.

func (*PodScraper) Start

func (s *PodScraper) Start(ctx context.Context) *bufio.Reader

Start returns a reader that streams the pod logs.

type SelectorScraper

type SelectorScraper struct {
	L klog.Logger
	// contains filtered or unexported fields
}

SelectorScraper scrapes all pods with a given selector.

func NewSelectorScraper

func NewSelectorScraper(client kubernetes.Interface, namespace string, defaultContainerName string, labelSelector string, tailLines *int64) *SelectorScraper

NewSelectorScraper creates a new SelectorScraper.

func (*SelectorScraper) Start

func (s *SelectorScraper) Start(ctx context.Context) *bufio.Reader

Start returns a reader that streams the log of all selected pods.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL