logger

package
v3.0.0-rc.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2016 License: Apache-2.0 Imports: 4 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 {
	// contains filtered or unexported fields
}

Logger the logger

func New

func New(c config.Logger) *Logger

New creates a new Logger from config.Logger configuration

func (*Logger) Dangerf

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

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

func (*Logger) Fatal

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

Fatal is equivalent to l.Dangerf("%#v",interface{}) followed by a call to panic().

func (*Logger) Fatalf

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

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

func (*Logger) Infof

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

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

func (*Logger) IsEnabled

func (l *Logger) IsEnabled() bool

IsEnabled returns true if Logger is enabled, otherwise false

func (*Logger) Otherf

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

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

func (*Logger) Panic

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

Panic is equivalent to l.Dangerf("%#v",interface{}) followed by a call to panic().

func (*Logger) Panicf

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

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

func (*Logger) Print

func (l *Logger) Print(a interface{})

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

func (*Logger) PrintBanner

func (l *Logger) PrintBanner(banner string, successMessage string)

PrintBanner prints a text (banner) with BannerFgColor, BannerBgColor and a success message at the end It doesn't cares if the logger is disabled or not, it will print this

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) ResetColors

func (l *Logger) ResetColors()

ResetColors sets the colors to the default this func is called every time a success, info, warning, or danger message is printed

func (*Logger) SetEnable

func (l *Logger) SetEnable(enable bool)

SetEnable true enables, false disables the Logger

func (*Logger) Successf

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

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

func (*Logger) Warningf

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

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

Jump to

Keyboard shortcuts

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