log

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: Apache-2.0 Imports: 9 Imported by: 316

Documentation

Index

Constants

View Source
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"

	JxLogFormat = "JX_LOG_FORMAT"
	JxLogFile   = "JX_LOG_FILE"
	JxLogLevel  = "JX_LOG_LEVEL"
)

Variables

This section is empty.

Functions

func Append added in v0.0.7

func Append(f io.Writer, data []byte) error

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

type Hook added in v0.0.7

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

Hook is a logrus hook for splunk

func NewHook added in v0.0.7

func NewHook(path string, levels []logrus.Level) *Hook

func (*Hook) Fire added in v0.0.7

func (h *Hook) Fire(entry *logrus.Entry) error

func (*Hook) Levels added in v0.0.7

func (h *Hook) Levels() []logrus.Level

Levels Required for logrus hook implementation

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