logprinter

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package logprinter is used to print container log lines in color

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultSingleNamespaceTemplate

func DefaultSingleNamespaceTemplate() *template.Template

DefaultSingleNamespaceTemplate returns a printing template used when printing with colors and watching resources in a single namespace

Types

type Log

type Log struct {
	// Message is the log message itself
	Message string `json:"message"`

	// Namespace of the pod
	Namespace string `json:"namespace"`

	// PodName of the pod
	PodName string `json:"podName"`

	// ContainerName of the container
	ContainerName string `json:"containerName"`

	PodColor       *color.Color `json:"-"`
	ContainerColor *color.Color `json:"-"`
}

Log is the object which will be used together with the template to generate the output.

type LogPrinter

type LogPrinter struct {
	Tmpl *template.Template
}

func (LogPrinter) Print

func (printer LogPrinter) Print(log Log, uiMsg *termui.Message)

Jump to

Keyboard shortcuts

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