go-eden/slf4go

Default example does not work on version 1.0.9

Closed this issue · 1 comments

Hi,

the default example does not work on the 1.0.9 version. There are no logs.

The version 1.0.8 works like expected.

2021-05-24 11:40:06.722457 [1] [DEBUG] [root] log.go:12 debug time: 2021-05-24 11:40:06.722442165 +0200 CEST m=+0.000102399
2021-05-24 11:40:06.722631 [1] [WARN ] [root] log.go:15 warn log
2021-05-24 11:40:06.722644 [1] [ERROR] [root] log.go:17 error log
2021-05-24 11:40:06.722679 [1] [PANIC] [root] log.go:20 panic time: 2021-05-24 11:40:06.722651348 +0200 CEST m=+0.000311567
goroutine 1 [running]:
runtime/debug.Stack(0x4b55e0, 0xc00009e370, 0x1)
        /usr/local/go/src/runtime/debug/stack.go:24 +0x9f
github.com/go-eden/slf4go.Panicf(0x4d1c4d, 0xe, 0xc00009e360, 0x1, 0x1)
        /home/andrej/go/pkg/mod/github.com/go-eden/slf4go@v1.0.8/slf_core.go:210 +0x8e
main.main()
        /home/andrej/go/src/github.com/lorislab/tmp/log.go:20 +0x1f9

br,
Andrej

The 1.0.9 version changed the default logger driver.

It will print logs asynchronously, you can add time.Sleep(time.Millisecond) to give it some extra time to print out... and I will fix the default example.

BTW, this asynchronously is for performance optimizing