docs: 手动实现 simple log 日志库

This commit is contained in:
Shikong 2021-10-06 15:35:21 +08:00
parent cd1c2fe26d
commit 42e5a2873d

View File

@ -14,7 +14,7 @@ func TestLog(t *testing.T) {
WithWriter(os.Stdout),
WithTimeFormat("2006-01-02"),
WithLogFormat("%-10s %s %v %s =-=-> %s\n"),
WithLogFlag(FlagInfo|FlagDebug),
WithLogFlag(FlagInfo|FlagWarn|FlagError),
)
fmt.Printf("simpleLog => %#v\n", log)
@ -30,6 +30,7 @@ func TestLog(t *testing.T) {
for i := 0; i < 5; i++ {
log2.Debug("测试 Debug 输出")
log2.Info("测试 Info 输出")
time.Sleep(100 * time.Millisecond)
}
}