Logy|Docs

YAML configuration

Load logging settings from a YAML file

Use logy.LoadConfigFromYaml when logging settings should live outside the Go binary.

main.go
func init() {
	if err := logy.LoadConfigFromYaml("logy.config.yaml"); err != nil {
		panic(err)
	}
}
logy.config.yaml
logy:
  level: INFO
  handlers:
    - console
  console:
    enabled: true
    target: stderr
    level: DEBUG
    color: true

YAML 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.