log

package
v2.1.41 Latest Latest
Warning

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

Go to latest
Published: May 19, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blank

func Blank()

Blank prints a blank line

func CaptureOutput

func CaptureOutput(f func()) string

CaptureOutput calls the specified function capturing and returning all logged messages.

func GetLevel

func GetLevel() string

GetLevel gets the current log level

func GetLevels

func GetLevels() []string

GetLevels returns the list of valid log levels

func Logger

func Logger() *logrus.Entry

Logger obtains the logger for use in the jx codebase This is the only way you should obtain a logger

func SetLevel

func SetLevel(s string) error

SetLevel sets the logging level

func SetOutput

func SetOutput(out io.Writer)

SetOutput sets the outputs for the default logger.

Types

type FormatLayoutType

type FormatLayoutType string

FormatLayoutType the layout kind

const (
	// FormatLayoutJSON uses JSON layout
	FormatLayoutJSON FormatLayoutType = "json"

	// FormatLayoutText uses classic colorful Jenkins X layout
	FormatLayoutText FormatLayoutType = "text"

	// FormatLayoutStackdriver uses a custom formatter for stackdriver
	FormatLayoutStackdriver FormatLayoutType = "stackdriver"
)

type JenkinsXTextFormat

type JenkinsXTextFormat struct {
	ShowInfoLevel   bool
	ShowTimestamp   bool
	TimestampFormat string
}

JenkinsXTextFormat lets use a custom text format

func NewJenkinsXTextFormat

func NewJenkinsXTextFormat() *JenkinsXTextFormat

NewJenkinsXTextFormat creates the default Jenkins X text formatter

func (*JenkinsXTextFormat) Format

func (f *JenkinsXTextFormat) Format(entry *logrus.Entry) ([]byte, error)

Format formats the log statement

Jump to

Keyboard shortcuts

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