logging

package
v0.0.0-...-a278cc6 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Color

func Color(colorString string) func(message string) string

Types

type Entry

type Entry struct {
	Level    LogLevel
	Contents string
}

type LogLevel

type LogLevel int
const (
	LogLevelError LogLevel
	LogLevelWarn
	LogLevelDebug
	LogLevelTrace
)

type Logger

type Logger struct {
	Logs             strings.Builder
	Entries          []Entry
	Rules            []parser.Rule
	ImportChart      map[string][]string
	ImportViolations []rulechecker.Violation
	Verbose          bool
	Completed        bool
}

func New

func New(verbose bool) *Logger

func (*Logger) AddAlways

func (l *Logger) AddAlways(contents string)

func (*Logger) AddDebug

func (l *Logger) AddDebug(contents string)

func (*Logger) FailWithError

func (l *Logger) FailWithError(message string, err error)

func (*Logger) FailWithErrors

func (l *Logger) FailWithErrors(message string, errs []error)

func (*Logger) FailWithMessage

func (l *Logger) FailWithMessage(message string)

func (*Logger) FailWithMessageCompleted

func (l *Logger) FailWithMessageCompleted(message string)

func (*Logger) Print

func (l *Logger) Print(completed bool)

func (*Logger) SetImportChart

func (l *Logger) SetImportChart(imports map[string][]string)

func (*Logger) SetImportViolations

func (l *Logger) SetImportViolations(violations []rulechecker.Violation)

func (*Logger) SetRules

func (l *Logger) SetRules(rules []parser.Rule)

func (*Logger) Success

func (l *Logger) Success()

Jump to

Keyboard shortcuts

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