log

package
v0.0.0-...-cb2bff1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2020 License: Apache-2.0 Imports: 9 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 Debug

func Debug(someString string, args ...interface{})

Requires verbose

func Error

func Error(someString string, args ...interface{})

Tell the user of an error, doesn't determine fatality

func Fatal

func Fatal(someString string, err error, args ...interface{}) error

Tell the user an error that was fatal

func GetLevels

func GetLevels() []string

GetLevels returns the list of valid log levels

func Info

func Info(someString string, args ...interface{})

Info for the user

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.

func Trace

func Trace(someString string, args ...interface{})

most Verbose

func Var

func Var(variable string, value ...interface{})

Helper functions so you can import BB log and just say log.Debug("some string %s", stringVar)

func Warn

func Warn(someString string, args ...interface{})

Warn the user

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"
)

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