完成基本的创建使用功能
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package logger
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime/debug"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func TestLogger(t *testing.T) {
|
||||
Init()
|
||||
logrus.Infoln("asdadsasd")
|
||||
time.Sleep(5 * time.Second)
|
||||
logrus.Infoln(string(debug.Stack()))
|
||||
logrus.WithFields(logrus.Fields{"RoleUid": "12313123123"}).Warn("asdasd")
|
||||
}
|
||||
|
||||
func TestLogger2(t *testing.T) {
|
||||
str := "goroutine 68 [running]:\\nruntime/debug.Stack()\\n\\tD:/work/environment/GO/src/runtime/debug/stack.go:24 +0x65\\ncolly_v2/pkg/zlib.Try.func1()\\n\\tE:/gopackage2/2023.10/colly_v2/pkg/zlib/try.go:12 "
|
||||
fmt.Println(len([]byte(str)))
|
||||
}
|
||||
|
||||
func TestLogger3(t *testing.T) {
|
||||
fmt.Println(time.Now().Unix() - 259200)
|
||||
}
|
||||
Reference in New Issue
Block a user