log

package
v0.0.0-...-23b95e8 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(i ...interface{})

Debug calls Output to print debug message to the standard logger.

func Debugf

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

Debugf calls Output to print debug message to the standard logger. Arguments are handled in the manner of fmt.Printf.

func Debugj

func Debugj(j JSON)

Debugj calls Output to print debug message to the standard logger.

func DisableColor

func DisableColor()

DisableColor disables colorized output.

func EnableColor

func EnableColor()

EnableColor enables colorized output.

func Error

func Error(i ...interface{})

Error calls Output to print error message to the standard logger.

func Errorf

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

Errorf calls Output to print error message to the standard logger. Arguments are handled in the manner of fmt.Printf.

func Errorj

func Errorj(j JSON)

Errorj calls Output to print error message to the standard logger.

func Fatal

func Fatal(i ...interface{})

Fatal calls Output to print fatal message to the standard logger.

func Fatalf

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

Fatalf calls Output to print fatal message to the standard logger. Arguments are handled in the manner of fmt.Printf.

func Fatalj

func Fatalj(j JSON)

Fatalj calls Output to print fatal message to the standard logger.

func Info

func Info(i ...interface{})

Info calls Output to print info message to the standard logger.

func Infof

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

Infof calls Output to print info message to the standard logger. Arguments are handled in the manner of fmt.Printf.

func Infoj

func Infoj(j JSON)

Infoj calls Output to print info message to the standard logger.

func Output

func Output() io.Writer

Output gets the output destination for the standard logger.

func Panic

func Panic(i ...interface{})

Panic calls Output to print panic message to the standard logger.

func Panicf

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

Panicf calls Output to print panic message to the standard logger. Arguments are handled in the manner of fmt.Printf.

func Panicj

func Panicj(j JSON)

Panicj calls Output to print panic message to the standard logger.

func Prefix

func Prefix() string

Prefix gets the output prefix for the standard logger.

func Print

func Print(i ...interface{})

Print calls Output to print to the standard logger.

func Printf

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

Printf calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Printf.

func Printj

func Printj(j JSON)

Printj calls Output to print to the standard logger.

func SetHeader

func SetHeader(h string)

SetHeader sets a logger header.

func SetLevel

func SetLevel(v Lvl)

SetLevel sets log level.

func SetOutput

func SetOutput(w io.Writer)

SetOutput sets the output destination for the standard logger.

func SetPrefix

func SetPrefix(p string)

SetPrefix sets the output prefix for the standard logger.

func Warn

func Warn(i ...interface{})

Warn calls Output to print warning message to the standard logger.

func Warnf

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

Warnf calls Output to print warning message to the standard logger. Arguments are handled in the manner of fmt.Printf.

func Warnj

func Warnj(j JSON)

Warnj calls Output to print warning message to the standard logger.

Types

type JSON

type JSON map[string]interface{}

JSON defines json format.

type Logger

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

Logger defines logger information.

func New

func New(prefix string) (l *Logger)

New creates a new logger.

func (*Logger) Color

func (l *Logger) Color() *color.Color

Color gets log color setting.

func (*Logger) Debug

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

Debug calls Output to print debug message to the standard logger.

func (*Logger) Debugf

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

Debugf calls Output to print debug message to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*Logger) Debugj

func (l *Logger) Debugj(j JSON)

Debugj calls Output to print debug message to the standard logger.

func (*Logger) DisableColor

func (l *Logger) DisableColor()

DisableColor disables colorized output.

func (*Logger) EnableColor

func (l *Logger) EnableColor()

EnableColor enables colorized output.

func (*Logger) Error

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

Error calls Output to print error message to the standard logger.

func (*Logger) Errorf

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

Errorf calls Output to print error message to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*Logger) Errorj

func (l *Logger) Errorj(j JSON)

Errorj calls Output to print error message to the standard logger.

func (*Logger) Fatal

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

Fatal calls Output to print fatal message to the standard logger.

func (*Logger) Fatalf

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

Fatalf calls Output to print fatal message to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*Logger) Fatalj

func (l *Logger) Fatalj(j JSON)

Fatalj calls Output to print fatal message to the standard logger.

func (*Logger) Info

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

Info calls Output to print info message to the standard logger.

func (*Logger) Infof

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

Infof calls Output to print info message to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*Logger) Infoj

func (l *Logger) Infoj(j JSON)

Infoj calls Output to print info message to the standard logger.

func (*Logger) Level

func (l *Logger) Level() Lvl

Level gets log level.

func (*Logger) Output

func (l *Logger) Output() io.Writer

Output gets the output destination for the standard logger.

func (*Logger) Panic

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

Panic calls Output to print panic message to the standard logger.

func (*Logger) Panicf

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

Panicf calls Output to print panic message to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*Logger) Panicj

func (l *Logger) Panicj(j JSON)

Panicj calls Output to print panic message to the standard logger.

func (*Logger) Prefix

func (l *Logger) Prefix() string

Prefix gets the output prefix for the standard logger.

func (*Logger) Print

func (l *Logger) Print(i ...interface{})

Print calls Output to print to the standard logger.

func (*Logger) Printf

func (l *Logger) Printf(format string, args ...interface{})

Printf calls Output to print to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*Logger) Printj

func (l *Logger) Printj(j JSON)

Printj calls Output to print to the standard logger.

func (*Logger) SetHeader

func (l *Logger) SetHeader(h string)

SetHeader sets a logger header.

func (*Logger) SetLevel

func (l *Logger) SetLevel(v Lvl)

SetLevel sets log level.

func (*Logger) SetOutput

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

SetOutput sets the output destination for the standard logger.

func (*Logger) SetPrefix

func (l *Logger) SetPrefix(p string)

SetPrefix sets the output prefix for the standard logger.

func (*Logger) Warn

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

Warn calls Output to print warning message to the standard logger.

func (*Logger) Warnf

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

Warnf calls Output to print warning message to the standard logger. Arguments are handled in the manner of fmt.Printf.

func (*Logger) Warnj

func (l *Logger) Warnj(j JSON)

Warnj calls Output to print warning message to the standard logger.

type Lvl

type Lvl uint8

Lvl defines log level.

const (
	DEBUG Lvl = iota + 1
	INFO
	WARN
	ERROR
	FATAL
	PANIC
	OFF
)

func Level

func Level() Lvl

Level gets log level.

Jump to

Keyboard shortcuts

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