jx: github.com/jenkins-x/jx/pkg/log Index | Files

package log

import "github.com/jenkins-x/jx/pkg/log"


Package Files


func Blank Uses

func Blank()

Blank prints a blank line

func CaptureOutput Uses

func CaptureOutput(f func()) string

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

func GetLevel Uses

func GetLevel() string

GetLevel gets the current log level

func GetLevels Uses

func GetLevels() []string

GetLevels returns the list of valid log levels

func Logger Uses

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 Uses

func SetLevel(s string) error

SetLevel sets the logging level

func SetOutput Uses

func SetOutput(out io.Writer)

SetOutput sets the outputs for the default logger.

type FormatLayoutType Uses

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 Uses

type JenkinsXTextFormat struct {
    ShowInfoLevel   bool
    ShowTimestamp   bool
    TimestampFormat string

JenkinsXTextFormat lets use a custom text format

func NewJenkinsXTextFormat Uses

func NewJenkinsXTextFormat() *JenkinsXTextFormat

NewJenkinsXTextFormat creates the default Jenkins X text formatter

func (*JenkinsXTextFormat) Format Uses

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

Format formats the log statement

Package log imports 10 packages (graph) and is imported by 65 packages. Updated 2020-03-11. Refresh now. Tools for package owners.