logger

package
v0.0.0-...-e8464d3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupLoggers

func SetupLoggers(loggersConfig []LoggerConfig) error

Types

type ILogger

type ILogger interface {
	D(format string, args ...interface{})
	I(format string, args ...interface{})
	N(format string, args ...interface{})
	W(format string, args ...interface{})
	E(format string, args ...interface{})
	C(format string, args ...interface{})
	Dc(c int, format string, args ...interface{})
	Ic(c int, format string, args ...interface{})
	Nc(c int, format string, args ...interface{})
	Wc(c int, format string, args ...interface{})
	Ec(c int, format string, args ...interface{})
	Cc(c int, format string, args ...interface{})
}

type Level

type Level = logging.Level
const (
	CRITICAL Level = iota
	ERROR
	WARNING
	NOTICE
	INFO
	DEBUG
	NONE
)

Log levels.

type Logger

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

func GetLogger

func GetLogger(module string) *Logger

func GetLoggerErr

func GetLoggerErr(module string) (*Logger, error)

func SetupLog

func SetupLog(module string, writer *os.File, level string, format string) (*Logger, error)

func SetupLogWithWriter

func SetupLogWithWriter(module string, writer *os.File, level string, format string, writerLevel string) (*Logger, error)

func (*Logger) C

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

func (*Logger) Cc

func (l *Logger) Cc(c int, format string, args ...interface{})

func (*Logger) Close

func (l *Logger) Close() (err error)

func (*Logger) D

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

func (*Logger) Dc

func (l *Logger) Dc(c int, format string, args ...interface{})

func (*Logger) E

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

func (*Logger) Ec

func (l *Logger) Ec(c int, format string, args ...interface{})

func (*Logger) I

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

func (*Logger) Ic

func (l *Logger) Ic(c int, format string, args ...interface{})

func (*Logger) N

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

func (*Logger) Nc

func (l *Logger) Nc(c int, format string, args ...interface{})

func (*Logger) W

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

func (*Logger) Wc

func (l *Logger) Wc(c int, format string, args ...interface{})

func (*Logger) Write

func (l *Logger) Write(p []byte) (n int, err error)

type LoggerConfig

type LoggerConfig struct {
	Name   string `yaml:"name"`
	Type   string `yaml:"type"`
	Format string `yaml:"format"`
	Level  string `yaml:"level"`
	Dest   string `yaml:"dest"`
}

type Password

type Password string

func (Password) Redacted

func (p Password) Redacted() interface{}

Jump to

Keyboard shortcuts

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