YAML configuration
Load logging settings from a YAML file
Use logy.LoadConfigFromYaml when logging settings should live outside the Go
binary.
func init() {
if err := logy.LoadConfigFromYaml("logy.config.yaml"); err != nil {
panic(err)
}
}logy:
level: INFO
handlers:
- console
console:
enabled: true
target: stderr
level: DEBUG
color: trueYAML is a good fit when different environments need different levels, formats, or output destinations. Keep the file close to deployment configuration so logging can change without code changes.
