logger

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2018 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const ENV_CART_LOG_LEVEL = "CART_LOG_LEVEL"

Variables

View Source
var Logger = &logger{}

Functions

func SetFileOutput

func SetFileOutput(dir string)

func SetLevel

func SetLevel(level Level)

func SetOutput

func SetOutput(writer io.Writer)

func SetStdout

func SetStdout()

Types

type FileWriter

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

func DefaultFileWriter

func DefaultFileWriter(dir string) *FileWriter

func NewFileWriter

func NewFileWriter(dir string, spliter Spliter) *FileWriter

func (*FileWriter) Write

func (w *FileWriter) Write(p []byte) (n int, err error)

type Level

type Level int
const (
	Info Level = 1 + iota
	Warn
	Error
)

type Spliter

type Spliter int
const (
	EveryMin Spliter = 1 + iota
	EveryHour
	EveryDay
)

Jump to

Keyboard shortcuts

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