Пример #1
0
func Test_CreateLogFailure(t *testing.T) {
	e := llog.New("/foo/bar", llog.INFO)
	if e == nil {
		t.Error("failed to provoke creation error!")
		return
	}
}
Пример #2
0
func Test_OpenLog(t *testing.T) {
	pe("Error", "Cannot be seen")
	e := llog.New(f, llog.INFO)
	if e != nil {
		t.Error("failed to open log : " + e.Error())
		return
	}
	pi("Info", "Line 1")
}
Пример #3
0
func Test_CreateLog(t *testing.T) {
	e := llog.New(f, llog.INFO)
	if e != nil {
		t.Error("failed to create log : " + e.Error())
		return
	}
	pm("", "Start of test")
	llog.Close()
}
Пример #4
0
func Example() {
	e := llog.New("/foo/bar", llog.INFO)
	if e != nil {
		fmt.Println("failed to create log : " + e.Error())
		return
	}
	llog.PrintInfo("My ID", "Test of llog")
	llog.Close()
}
Пример #5
0
func Test_Rotate(t *testing.T) {
	e := llog.New(fr, llog.INFO)
	if e != nil {
		t.Error("failed to open log : " + e.Error())
		return
	}
	pi("Info", "Line 1 pre rotate")
	pi("Info", "Line 2 pre rotate")
	e = llog.Rotate(3)
	if e != nil {
		t.Error("failed to rotate log : " + e.Error())
		return
	}
	pi("Info", "Line 1 after rotate")
	pi("Info", "Line 2 after rotate")
}