log

package
v2.5.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2018 License: Apache-2.0 Imports: 11 Imported by: 48

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Discard = &DiscardLogger{}

Discard is a logger implementation that just discards every log statement

View Source
var Logdir = "./.devspace/logs/"

Logdir specifies the relative path to the devspace logs

Functions

func Debug

func Debug(args ...interface{})

Debug prints debug information

func Debugf

func Debugf(format string, args ...interface{})

Debugf prints formatted debug information

func Done

func Done(args ...interface{})

Done prints done information

func Donef

func Donef(format string, args ...interface{})

Donef prints formatted info information

func Error

func Error(args ...interface{})

Error prints error information

func Errorf

func Errorf(format string, args ...interface{})

Errorf prints formatted error information

func Fail

func Fail(args ...interface{})

Fail prints error information

func Failf

func Failf(format string, args ...interface{})

Failf prints formatted error information

func Fatal

func Fatal(args ...interface{})

Fatal prints fatal error information

func Fatalf

func Fatalf(format string, args ...interface{})

Fatalf prints formatted fatal error information

func Info

func Info(args ...interface{})

Info prints info information

func Infof

func Infof(format string, args ...interface{})

Infof prints formatted information

func OverrideRuntimeErrorHandler

func OverrideRuntimeErrorHandler()

OverrideRuntimeErrorHandler overrides the standard runtime error handler that logs to stdout with a file logger that logs all runtime.HandleErrors to errors.log

func Panic

func Panic(args ...interface{})

Panic prints panic information

func Panicf

func Panicf(format string, args ...interface{})

Panicf prints formatted panic information

func Print

func Print(level logrus.Level, args ...interface{})

Print prints information

func PrintTable

func PrintTable(header []string, values [][]string)

PrintTable prints a table with header columns and string values

func Printf

func Printf(level logrus.Level, format string, args ...interface{})

Printf prints formatted information

func SetLevel

func SetLevel(level logrus.Level)

SetLevel changes the log level of the global logger

func StartFileLogging

func StartFileLogging()

StartFileLogging logs the output of the global logger to the file default.log

func StartWait

func StartWait(message string)

StartWait prints a wait message until StopWait is called

func StopWait

func StopWait()

StopWait stops printing the wait message

func Warn

func Warn(args ...interface{})

Warn prints warning information

func Warnf

func Warnf(format string, args ...interface{})

Warnf prints formatted warning information

func Write

func Write(message []byte)

Write writes to the stdout log without formatting the message, but takes care of locking the log and halting a possible wait message

func WriteColored

func WriteColored(message string, color ct.Color)

WriteColored writes a message in color

Types

type DiscardLogger

type DiscardLogger struct{}

DiscardLogger just discards every log statement

func (*DiscardLogger) Debug

func (d *DiscardLogger) Debug(args ...interface{})

Debug implements logger interface

func (*DiscardLogger) Debugf

func (d *DiscardLogger) Debugf(format string, args ...interface{})

Debugf implements logger interface

func (*DiscardLogger) Done

func (d *DiscardLogger) Done(args ...interface{})

Done implements logger interface

func (*DiscardLogger) Donef

func (d *DiscardLogger) Donef(format string, args ...interface{})

Donef implements logger interface

func (*DiscardLogger) Error

func (d *DiscardLogger) Error(args ...interface{})

Error implements logger interface

func (*DiscardLogger) Errorf

func (d *DiscardLogger) Errorf(format string, args ...interface{})

Errorf implements logger interface

func (*DiscardLogger) Fail

func (d *DiscardLogger) Fail(args ...interface{})

Fail implements logger interface

func (*DiscardLogger) Failf

func (d *DiscardLogger) Failf(format string, args ...interface{})

Failf implements logger interface

func (*DiscardLogger) Fatal

func (d *DiscardLogger) Fatal(args ...interface{})

Fatal implements logger interface

func (*DiscardLogger) Fatalf

func (d *DiscardLogger) Fatalf(format string, args ...interface{})

Fatalf implements logger interface

func (*DiscardLogger) Info

func (d *DiscardLogger) Info(args ...interface{})

Info implements logger interface

func (*DiscardLogger) Infof

func (d *DiscardLogger) Infof(format string, args ...interface{})

Infof implements logger interface

func (*DiscardLogger) Panic

func (d *DiscardLogger) Panic(args ...interface{})

Panic implements logger interface

func (*DiscardLogger) Panicf

func (d *DiscardLogger) Panicf(format string, args ...interface{})

Panicf implements logger interface

func (*DiscardLogger) Print

func (d *DiscardLogger) Print(level logrus.Level, args ...interface{})

Print implements logger interface

func (*DiscardLogger) PrintTable

func (d *DiscardLogger) PrintTable(header []string, values [][]string)

PrintTable implements logger interface

func (*DiscardLogger) Printf

func (d *DiscardLogger) Printf(level logrus.Level, format string, args ...interface{})

Printf implements logger interface

func (*DiscardLogger) SetLevel

func (d *DiscardLogger) SetLevel(level logrus.Level)

SetLevel implements logger interface

func (*DiscardLogger) StartWait

func (d *DiscardLogger) StartWait(message string)

StartWait implements logger interface

func (*DiscardLogger) StopWait

func (d *DiscardLogger) StopWait()

StopWait implements logger interface

func (*DiscardLogger) Warn

func (d *DiscardLogger) Warn(args ...interface{})

Warn implements logger interface

func (*DiscardLogger) Warnf

func (d *DiscardLogger) Warnf(format string, args ...interface{})

Warnf implements logger interface

func (*DiscardLogger) With

func (d *DiscardLogger) With(obj interface{}) *LoggerEntry

With implements logger interface

func (*DiscardLogger) WithKey

func (d *DiscardLogger) WithKey(key string, obj interface{}) *LoggerEntry

WithKey implements logger interface

func (*DiscardLogger) Write

func (d *DiscardLogger) Write(message []byte) (int, error)

Write implements logger interface

type Logger

type Logger interface {
	Debug(args ...interface{})
	Debugf(format string, args ...interface{})

	Info(args ...interface{})
	Infof(format string, args ...interface{})

	Warn(args ...interface{})
	Warnf(format string, args ...interface{})

	Error(args ...interface{})
	Errorf(format string, args ...interface{})

	Fatal(args ...interface{})
	Fatalf(format string, args ...interface{})

	Panic(args ...interface{})
	Panicf(format string, args ...interface{})

	Done(args ...interface{})
	Donef(format string, args ...interface{})

	Fail(args ...interface{})
	Failf(format string, args ...interface{})

	StartWait(message string)
	StopWait()

	PrintTable(header []string, values [][]string)

	With(object interface{}) *LoggerEntry
	WithKey(key string, object interface{}) *LoggerEntry

	Print(level logrus.Level, args ...interface{})
	Printf(level logrus.Level, format string, args ...interface{})

	Write(message []byte) (int, error)
	SetLevel(level logrus.Level)
	// contains filtered or unexported methods
}

Logger defines the common logging interface

func GetFileLogger

func GetFileLogger(filename string) Logger

GetFileLogger returns a logger instance for the specified filename

func GetInstance

func GetInstance() Logger

GetInstance returns the Logger instance

type LoggerEntry

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

LoggerEntry defines an entry to the logger

func With

func With(obj interface{}) *LoggerEntry

With adds context information to the entry

func WithKey

func WithKey(key string, obj interface{}) *LoggerEntry

WithKey adds context information to the entry

func (*LoggerEntry) Debug

func (l *LoggerEntry) Debug(args ...interface{})

Debug prints debug information

func (*LoggerEntry) Debugf

func (l *LoggerEntry) Debugf(format string, args ...interface{})

Debugf prints formatted debug information

func (*LoggerEntry) Done

func (l *LoggerEntry) Done(args ...interface{})

Done prints info information

func (*LoggerEntry) Donef

func (l *LoggerEntry) Donef(format string, args ...interface{})

Donef prints formatted info information

func (*LoggerEntry) Error

func (l *LoggerEntry) Error(args ...interface{})

Error prints error information

func (*LoggerEntry) Errorf

func (l *LoggerEntry) Errorf(format string, args ...interface{})

Errorf prints formatted error information

func (*LoggerEntry) Fail

func (l *LoggerEntry) Fail(args ...interface{})

Fail prints error information

func (*LoggerEntry) Failf

func (l *LoggerEntry) Failf(format string, args ...interface{})

Failf prints formatted error information

func (*LoggerEntry) Fatal

func (l *LoggerEntry) Fatal(args ...interface{})

Fatal prints fatal error information

func (*LoggerEntry) Fatalf

func (l *LoggerEntry) Fatalf(format string, args ...interface{})

Fatalf prints formatted fatal error information

func (*LoggerEntry) Info

func (l *LoggerEntry) Info(args ...interface{})

Info prints info information

func (*LoggerEntry) Infof

func (l *LoggerEntry) Infof(format string, args ...interface{})

Infof prints formatted info information

func (*LoggerEntry) Panic

func (l *LoggerEntry) Panic(args ...interface{})

Panic prints panic information

func (*LoggerEntry) Panicf

func (l *LoggerEntry) Panicf(format string, args ...interface{})

Panicf prints formatted panic information

func (*LoggerEntry) Print

func (l *LoggerEntry) Print(level logrus.Level, args ...interface{})

Print prints information

func (*LoggerEntry) Printf

func (l *LoggerEntry) Printf(level logrus.Level, format string, args ...interface{})

Printf prints formatted information

func (*LoggerEntry) Warn

func (l *LoggerEntry) Warn(args ...interface{})

Warn prints warn information

func (*LoggerEntry) Warnf

func (l *LoggerEntry) Warnf(format string, args ...interface{})

Warnf prints formatted warn information

func (*LoggerEntry) With

func (l *LoggerEntry) With(obj interface{}) *LoggerEntry

With adds context information to the entry

func (*LoggerEntry) WithKey

func (l *LoggerEntry) WithKey(key string, obj interface{}) *LoggerEntry

WithKey adds context information to the entry

Jump to

Keyboard shortcuts

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