Skip to content
/ log Public

Golang log wrapper for standard log, support auto rotate file mechanism.

License

Notifications You must be signed in to change notification settings

leoxk/log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

log

Build Status GoDoc Go Report Card

Overview

a log wrapper for standard log, support auto rotate file mechanism.

Usage

func TestLogger(t *testing.T) {
	l := NewLogger()

	Convey("Without setting, the default writer should be terminal", t, func() {
		l.SetLevel(LInfo)

		l.Info("test Info")
		l.Infoln("test Infoln")
		l.Error("test Error")
		l.Errorln("test Errorln")
		l.Fatal("test Fatal")
		l.Fatalln("test Fatalln")
	})

	Convey("After setting a file writer", t, func() {
		prefix := fmt.Sprintf("%s/test_rotate_file_writer.%d", os.TempDir(), rand.Int())
		w := NewRotateFileWriter(prefix)
		l.SetWriter(w)
	})
}

About

Golang log wrapper for standard log, support auto rotate file mechanism.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages