inconshreveable / log15

Structured, composable logging for Go
https://godoc.org/github.com/inconshreveable/log15
Other
1.1k stars 145 forks source link

add configurable feature with yaml file #146

Closed jameszo closed 6 years ago

jameszo commented 6 years ago

I try to add a simple function to make logger by configuration of yaml file,Hoping log15 can be used by configuration as log4j.

The config file "log15.yml" shows how to config logger by now. And The test code in "config_test.go" shows how to get logger configurated in "log15.yml". After getting logger, then it can by used as former.

If it`s welcomed, I will continue to improve the configurable feature.

kevinburke commented 6 years ago

Thank you for this! I don't think this is a direction we want to go in for this library, though :( Maybe you can try publishing this as a separate library for configuring log15 from a file!