You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: document settings overrides and env precedence
Add "Programmatic configuration" section to README covering:
- Table mapping each env var to its programmatic Option equivalent
- WithoutEnvSettings for ignoring all env vars
- Precedence order: programmatic options > env vars > defaults
- Note that WithLogger disables log level/format options
- Usage examples for overrides, WithoutEnvSettings, and WithLogger
Additionally, `f1.WithoutEnvSettings()` can be used to ignore all environment variables and start from default values.
116
+
117
+
#### Precedence
118
+
119
+
Settings are resolved in this order (highest priority first):
120
+
121
+
1.**Programmatic options** — values passed to `f1.New()`
122
+
2.**Environment variables** — read at construction time
123
+
3.**Defaults** — info level, text format, no Prometheus push
124
+
125
+
When `f1.WithLogger(logger)` is used, the caller owns the logger entirely. In this case `WithLogLevel`, `WithLogFormat`, `F1_LOG_LEVEL` and `F1_LOG_FORMAT` have no effect.
126
+
127
+
```golang
128
+
// Example: override push gateway and log level programmatically
0 commit comments