Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
func FromOptions ¶
FromOptions returns a populated config derived from the provided Options
type Option ¶
type Option func(cfg *Config)
var FromEnv Option = func(cfg *Config) { humanLog, _ := strconv.ParseBool(os.Getenv("HUMAN_LOG")) cfg.Pretty = humanLog if s := os.Getenv("LOG_LEVEL"); s != "" { if l, err := levelFromString(s); err == nil { cfg.Level = l } } }
FromEnv is a config option that processes environment variables and populates the config with the contents of those vars
Pretty is an option that makes the output human-readable
Click to show internal directories.
Click to hide internal directories.