onrik / logrus

Hooks for logrus logging
MIT License
122 stars 30 forks source link

if the filepath of my proc include "logrus", the output of filename will be worry #5

Closed spiderpoison closed 6 years ago

spiderpoison commented 6 years ago

for example i have a proc in path "logrus_test" like this:

func main() { log.AddHook(filename.NewHook())

log.SetLevel(log.DebugLevel)

log.Debug("Useful debugging information.")

}

the output like this:

time="2018-08-01T19:37:01+08:00" level=debug msg="Useful debugging information." source="runtime/proc.go:195"

onrik commented 6 years ago

Fixed.

shutcode commented 5 years ago

if my project named "logrus"(like go/src/test/logrus), it's still wrong. It is not enough: SkipPrefixes: []string{"logrus/", "logrus@"},

onrik commented 5 years ago

@shutcode You can customise SkipPrefixes.

hook := filename.NewHook()
hook.SkipPrefixes = []string{"Custom", "prefixes"}