Skip to content

Commit

Permalink
Error on unrecognized level
Browse files Browse the repository at this point in the history
Signed-off-by: albertteoh <[email protected]>
  • Loading branch information
albertteoh committed Mar 10, 2021
1 parent 729067c commit 62cdf8b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/es/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"crypto/tls"
"errors"
"fmt"
"io/ioutil"
"net/http"
"os"
Expand Down Expand Up @@ -408,8 +409,10 @@ func addLoggerOptions(options []elastic.ClientOptionFunc, logLevel string) ([]el
options = append(options, elastic.SetTraceLog(l))
case "info":
options = append(options, elastic.SetInfoLog(l))
default:
case "error":
options = append(options, elastic.SetErrorLog(l))
default:
return options, fmt.Errorf("unrecognized log-level: \"%s\"", logLevel)
}
return options, nil
}
Expand Down

0 comments on commit 62cdf8b

Please sign in to comment.