cleanup paths
This commit is contained in:
parent
307ff646e0
commit
113dc5451a
1 changed files with 9 additions and 0 deletions
|
@ -1,8 +1,11 @@
|
|||
package gologger
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"runtime"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
|
@ -20,6 +23,12 @@ func Get(l string) zerolog.Logger {
|
|||
var output io.Writer = zerolog.ConsoleWriter{
|
||||
Out: os.Stdout,
|
||||
TimeFormat: time.RFC3339,
|
||||
FormatCaller: func(i interface{}) string {
|
||||
_, vpath, _, _ := runtime.Caller(0)
|
||||
bpath, _, _ := strings.Cut(vpath, "vendor/")
|
||||
_, ret, _ := strings.Cut(fmt.Sprintf("%s", i), bpath)
|
||||
return ret
|
||||
},
|
||||
}
|
||||
level, err := zerolog.ParseLevel(l)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue