Skip to content

Commit

Permalink
把所有error汇总统计,优化参数设置
Browse files Browse the repository at this point in the history
  • Loading branch information
Xuzan9396 committed Apr 3, 2023
1 parent 42b1562 commit 94fac2c
Show file tree
Hide file tree
Showing 131 changed files with 12,990 additions and 144 deletions.
Binary file added .DS_Store
Binary file not shown.
96 changes: 81 additions & 15 deletions crontab_test.go
Original file line number Diff line number Diff line change
@@ -1,49 +1,115 @@
package zlog

import (
"fmt"
"strconv"
"testing"
"time"
)

func Test_log(t *testing.T) {
func Test_log(t *testing.T) {

i := 1

SetEnv(LOG_DEBUG)
for{
F().Infof("%s","测试下好不好" + strconv.Itoa(i))
SetEnv(LOG_PRO)
for {
F().Infof("%s", "测试下好不好"+strconv.Itoa(i))
//F("xuzan2").Error(errors.New("错误"))
if i >= 1000{
if i >= 1000 {
break
}
t.Log(i,F() == nil ,F())
time.Sleep(1*time.Second)
t.Log(i, F() == nil, F())
time.Sleep(1 * time.Second)

i++
//glg.Infof("in main args:%v", os.Args)
//glg.Errorf("eerror %v", "error")
}
time.Sleep(5*time.Second)
time.Sleep(5 * time.Second)
}


func Test_logv2(t *testing.T) {
func Test_logv2(t *testing.T) {

i := 1

SetEnv(LOG_DEBUG)
for{
Infof("%s","测试下好不好" + strconv.Itoa(i))
for {
Infof("%s", "测试下好不好"+strconv.Itoa(i))
//F("xuzan2").Error(errors.New("错误"))
if i >= 1000{
if i >= 1000 {
break
}
time.Sleep(1*time.Second)
time.Sleep(1 * time.Second)
i++
//glg.Infof("in main args:%v", os.Args)
//glg.Errorf("eerror %v", "error")
}
time.Sleep(5*time.Second)
time.Sleep(5 * time.Second)
}

// 4.3更新
func Test_logv3(t *testing.T) {

i := 1
//SetEnv(LOG_PRO)
SetLog(ENV_DEBUG, WithMaxAge(10*24), WithRotationTime(24))
for {
F().Infof("%s", "测试下好不好"+strconv.Itoa(i))
F().Debugf("%s", "debug测试下好不好"+strconv.Itoa(i))
F().Errorf("%s", "error测试下好不好"+strconv.Itoa(i))
if i >= 1000 {
break
}
t.Log(i, F() == nil, F())
time.Sleep(1 * time.Second)

i++

}
time.Sleep(5 * time.Second)
}

func Test_logv4(t *testing.T) {

i := 1
//SetEnv(ENV_DEBUG)
SetLog(ENV_DEBUG)
//SetLog(ENV_DEBUG, WithMaxAge(10*24), WithRotationTime(24))

for is := 0; is <= 10; is++ {
go func(is int) {
for {

F(fmt.Sprintf("test_%d", is)).Errorf("%s", fmt.Sprintf("v4_%d_error测试"+strconv.Itoa(i), is))

//t.Log(i, F() == nil, F())
time.Sleep(3 * time.Second)

}
}(is)
}

select {}
}

func Test_logv5(t *testing.T) {

i := 1
//SetEnv(ENV_DEBUG)
SetLog(ENV_DEBUG)
//SetLog(ENV_DEBUG, WithMaxAge(10*24), WithRotationTime(24))

for is := 0; is <= 10; is++ {
go func(is int) {
for {

F("test").Errorf("%s", fmt.Sprintf("v5_%d_error测试"+strconv.Itoa(i), is))

time.Sleep(10 * time.Second)

}
}(is)
}

select {}
}
22 changes: 22 additions & 0 deletions vendor/github.com/lestrrat-go/file-rotatelogs/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions vendor/github.com/lestrrat-go/file-rotatelogs/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions vendor/github.com/lestrrat-go/file-rotatelogs/Changes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions vendor/github.com/lestrrat-go/file-rotatelogs/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 94fac2c

Please sign in to comment.