logsip: github.com/iamthemuffinman/logsip Index | Files

package logsip

import "github.com/iamthemuffinman/logsip"

Index

Package Files

logger.go logsip.go prettyprint.go

Variables

var IsTerminal = isatty.IsTerminal(os.Stdout.Fd())

IsTerminal defines whether we have a terminal or not

func Debug Uses

func Debug(v ...interface{})

Debug works just like log.Print, but with a Purple "DEBUG[0000]" prefix.

func Debugf Uses

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

Debugf works just like log.Printf, but with a Purple "DEBUG[0000]" prefix.

func Debugln Uses

func Debugln(v ...interface{})

Debugln works just like log.Println, but with a Purple "DEBUG[0000]" prefix.

func Error Uses

func Error(v ...interface{})

Error works just like log.Print, but with a Red "ERROR[0000]" prefix.

func Errorf Uses

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

Errorf works just like log.Printf, but with a Red "ERROR[0000]" prefix.

func Errorln Uses

func Errorln(v ...interface{})

Errorln works just like log.Println, but with a Red "ERROR[0000]" prefix.

func Fatal Uses

func Fatal(v ...interface{})

Fatal works just like log.Fatal, but with a Red "FATAL[0000]" prefix.

func Fatalf Uses

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

Fatalf works just like log.Fatalf, but with a Red "FATAL[0000]" prefix.

func Fatalln Uses

func Fatalln(v ...interface{})

Fatalln works just like log.Fatalln, but with a Red "FATAL[0000]" prefix.

func Info Uses

func Info(v ...interface{})

Info works just like log.Print, but with a Blue "INFO[0000]" prefix.

func Infof Uses

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

Infof works just like log.Printf, but with a Blue "INFO[0000]" prefix.

func Infoln Uses

func Infoln(v ...interface{})

Infoln works just like log.Println, but with a Blue "INFO[0000]" prefix.

func Panic Uses

func Panic(v ...interface{})

Panic works just like log.Panic, but with a Red "PANIC[0000]" prefix.

func Panicf Uses

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

Panicf works just like log.Panicf, but with a Red "PANIC[0000]" prefix.

func Panicln Uses

func Panicln(v ...interface{})

Panicln works just like log.Panicln, but with a Red "PANIC[0000]" prefix.

func SetLevel Uses

func SetLevel(level Level)

SetLevel is a function to set the log level (i.e Info, Warn, Debug, etc.)

func SetOutput Uses

func SetOutput(w io.Writer)

SetOutput allows you to use the global logger with any io.Writer

func Warn Uses

func Warn(v ...interface{})

Warn works just like log.Print, but with a Yellow "WARN[0000]" prefix.

func Warnf Uses

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

Warnf works just like log.Printf, but with a Yellow "WARN[0000]" prefix.

func Warnln Uses

func Warnln(v ...interface{})

Warnln works just like log.Println, but with a Yellow "WARN[0000]" prefix.

type Level Uses

type Level uint8

Level is a type that represents the log level

const (
    // PanicLevel is the lowest level
    PanicLevel Level = iota
    FatalLevel
    ErrorLevel
    WarnLevel
    InfoLevel
    DebugLevel
)

func GetLevel Uses

func GetLevel() Level

GetLevel is a function to get the current log level

func (Level) String Uses

func (level Level) String() string

type Logger Uses

type Logger struct {
    Level Level

    *log.Logger
    // contains filtered or unexported fields
}

func New Uses

func New() *Logger

New returns a new logger

func (*Logger) Debug Uses

func (l *Logger) Debug(v ...interface{})

Debug works just like log.Print, but with a Purple "DEBUG[0000]" prefix.

func (*Logger) Debugf Uses

func (l *Logger) Debugf(format string, v ...interface{})

Debugf works just like log.Printf, but with a Purple "DEBUG[0000]" prefix.

func (*Logger) Debugln Uses

func (l *Logger) Debugln(v ...interface{})

Debugln works just like log.Println, but with a Purple "DEBUG[0000]" prefix.

func (*Logger) Error Uses

func (l *Logger) Error(v ...interface{})

Error works just like log.Print, but with a Red "ERROR[0000]" prefix.

func (*Logger) Errorf Uses

func (l *Logger) Errorf(format string, v ...interface{})

Errorf works just like log.Printf, but with a Red "ERROR[0000]" prefix.

func (*Logger) Errorln Uses

func (l *Logger) Errorln(v ...interface{})

Errorln works just like log.Println, but with a Red "ERROR[0000]" prefix.

func (*Logger) Fatal Uses

func (l *Logger) Fatal(v ...interface{})

Fatal works just like log.Fatal, but with a Red "FATAL[0000]" prefix.

func (*Logger) Fatalf Uses

func (l *Logger) Fatalf(format string, v ...interface{})

Fatalf works just like log.Fatalf, but with a Red "FATAL[0000]" prefix.

func (*Logger) Fatalln Uses

func (l *Logger) Fatalln(v ...interface{})

Fatalln works just like log.Fatalln, but with a Red "FATAL[0000]" prefix.

func (*Logger) GetLevel Uses

func (logger *Logger) GetLevel() Level

GetLevel is a method to get the current log level

func (*Logger) Info Uses

func (l *Logger) Info(v ...interface{})

Info works just like log.Print, but with a Blue "INFO[0000]" prefix.

func (*Logger) Infof Uses

func (l *Logger) Infof(format string, v ...interface{})

Infof works just like log.Printf, but with a Blue "INFO[0000]" prefix.

func (*Logger) Infoln Uses

func (l *Logger) Infoln(v ...interface{})

Infoln works just like log.Println, but with a Blue "INFO[0000]" prefix.

func (*Logger) Panic Uses

func (l *Logger) Panic(v ...interface{})

Panic works just like log.Panic, but with a Red "PANIC[0000]" prefix.

func (*Logger) Panicf Uses

func (l *Logger) Panicf(format string, v ...interface{})

Panicf works just like log.Panicf, but with a Red "PANIC[0000]" prefix.

func (*Logger) Panicln Uses

func (l *Logger) Panicln(v ...interface{})

Panicln works just like log.Panicln, but with a Red "PANIC[0000]" prefix.

func (*Logger) SetLevel Uses

func (logger *Logger) SetLevel(level Level)

SetLevel is a method to set the log level (i.e Info, Warn, Debug, etc.)

func (*Logger) SetOutput Uses

func (logger *Logger) SetOutput(w io.Writer)

func (*Logger) Warn Uses

func (l *Logger) Warn(v ...interface{})

Warn works just like log.Print, but with a Yellow "WARN[0000]" prefix.

func (*Logger) Warnf Uses

func (l *Logger) Warnf(format string, v ...interface{})

Warnf works just like log.Printf, but with a Yellow "WARN[0000]" prefix.

func (*Logger) Warnln Uses

func (l *Logger) Warnln(v ...interface{})

Warnln works just like log.Println, but with a Yellow "WARN[0000]" prefix.

Package logsip imports 10 packages (graph) and is imported by 6 packages. Updated 2018-12-23. Refresh now. Tools for package owners.