logger

package
v3.0.0-beta+incompatible Latest Latest
Warning

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

Go to latest
Published: May 30, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

README

Package information

I decide to split the logger from the main iris package because logger.go doesn't depends on any of the iris' types.

Examples and more info will be added soon.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Prefix is the prefix for the logger, default is [IRIS]
	Prefix = "[IRIS] "
)

Functions

This section is empty.

Types

type Logger

type Logger struct {
	Logger *log.Logger
	// contains filtered or unexported fields
}

Logger is just a log.Logger

func New

func New(cfg ...config.Logger) *Logger

New creates a new Logger. The out variable sets the destination to which log data will be written. The prefix appears at the beginning of each generated log line. The flag argument defines the logging properties.

func (*Logger) Fatal

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

Fatal is equivalent to l.Print() followed by a call to os.Exit(1).

func (*Logger) Fatalf

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

Fatalf is equivalent to l.Printf() followed by a call to os.Exit(1).

func (*Logger) Fatalln

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

Fatalln is equivalent to l.Println() followed by a call to os.Exit(1).

func (*Logger) IsEnabled

func (l *Logger) IsEnabled() bool

IsEnabled returns true if Logger is enabled, otherwise false

func (*Logger) Panic

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

Panic is equivalent to l.Print() followed by a call to panic().

func (*Logger) Panicf

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

Panicf is equivalent to l.Printf() followed by a call to panic().

func (*Logger) Panicln

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

Panicln is equivalent to l.Println() followed by a call to panic().

func (*Logger) Print

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

Print calls l.Output to print to the logger. Arguments are handled in the manner of fmt.Print.

func (*Logger) Printf

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

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

func (*Logger) Println

func (l *Logger) Println(a ...interface{})

Println calls l.Output to print to the logger. Arguments are handled in the manner of fmt.Println.

func (*Logger) SetEnable

func (l *Logger) SetEnable(enable bool)

SetEnable true enables, false disables the Logger

Jump to

Keyboard shortcuts

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