logs

package module
v0.0.0-...-af334aa Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2020 License: MIT Imports: 10 Imported by: 5

README

log

a simple golang log package

Documentation

Index

Constants

View Source
const (
	//size
	KB              = 1024
	MB              = KB * 1024
	MinSizeInterval = 10 * KB //10KB
	//time
	Second          = 1
	Minute          = 60 * Second
	MinTimeInterval = 10 * Second //10Second
)

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

func Debugf

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

func Error

func Error(args ...interface{})

func Errorf

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

func Fatal

func Fatal(args ...interface{})

func Fatalf

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

func Info

func Info(args ...interface{})

func Infof

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

func Warn

func Warn(args ...interface{})

func Warnf

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

Types

type Level

type Level int
const (
	DebugLevel Level = iota
	InfoLevel
	WarnLevel
	ErrorLevel
	LastLevel
)

type Logger

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

func Log

func Log() *Logger

func (*Logger) Initialize

func (l *Logger) Initialize()

func (*Logger) WithLevel

func (l *Logger) WithLevel(level Level) *Logger

func (*Logger) WithLogFile

func (l *Logger) WithLogFile(dir, path string) *Logger

func (*Logger) WithRolling

func (l *Logger) WithRolling(rolling Rolling, interval int64) *Logger

type Rolling

type Rolling int
const (
	FirstRolling Rolling = iota
	TimeRolling
	SizeRolling
	LastRolling
)

Jump to

Keyboard shortcuts

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