logs

package
v1.10.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartsLogsStreaming

func StartsLogsStreaming(ctx context.Context, clientset *kubernetes.Clientset, namespace, name string, out chan<- []byte) error

StartsLogsStreaming reads the data from request and writes into the out channel. It buffers data from requests until the newline or io.EOF occurs in the data, so it doesn't interleave logs sub-line when running concurrently.

A successful read returns err == nil, not err == io.EOF. Because the function is defined to read from request until io.EOF, it does not treat an io.EOF as an error to be reported.

Types

type JSONParser

type JSONParser struct{}

JSONParser knows how to parse JSON formatted logs.

func (*JSONParser) ParseLineIntoCharm

func (j *JSONParser) ParseLineIntoCharm(line string) ([]any, charmlog.Level)

ParseLineIntoCharm returns parsed log line with charm logger support.

type Printer

type Printer struct {
	// contains filtered or unexported fields
}

Printer knows how to print Botkube logs.

func NewPrinter

func NewPrinter(podName string) *Printer

NewPrinter creates a new Printer instance.

func (*Printer) PrintLine

func (f *Printer) PrintLine(line string)

Jump to

Keyboard shortcuts

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