We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent baae930 commit 86ff925Copy full SHA for 86ff925
extra/reqlog/middleware.go
@@ -40,14 +40,17 @@ func WithVerbose(on bool) Option {
40
// - BUNDEBUG=0 - disables the middleware.
41
// - BUNDEBUG=1 - enables the middleware.
42
// - BUNDEBUG=2 - enables the middleware and verbose mode.
43
-func FromEnv(key string) Option {
44
- if key == "" {
45
- key = "BUNDEBUG"
+func FromEnv(keys ...string) Option {
+ if len(keys) == 0 {
+ keys = []string{"BUNDEBUG"}
46
}
47
return func(m *middleware) {
48
- if env, ok := os.LookupEnv(key); ok {
49
- m.enabled = env != "" && env != "0"
50
- m.verbose = env == "2"
+ for _, key := range keys {
+ if env, ok := os.LookupEnv(key); ok {
+ m.enabled = env != "" && env != "0"
51
+ m.verbose = env == "2"
52
+ break
53
+ }
54
55
56
0 commit comments