No need to verify log levels

This commit is contained in:
Kishan Mohanbhai Sagathiya 2019-12-06 11:22:08 +05:30
parent df36995213
commit a136509522
2 changed files with 0 additions and 16 deletions

View File

@ -615,9 +615,6 @@ func setupLogLevel(debug bool, l string) error {
return errors.New("log level not in expected format \"identifier:loglevel\" or \"loglevel\"")
}
if !ipfscluster.IsLogLevel(lvl) {
return fmt.Errorf("%s is not a valid log level", lvl)
}
_, ok := compLogFacs[comp]
if ok {
fmt.Printf("overwriting existing %s log level\n", comp)

View File

@ -1,8 +1,6 @@
package ipfscluster
import (
"strings"
logging "github.com/ipfs/go-log"
)
@ -70,14 +68,3 @@ func SetFacilityLogLevel(f, l string) {
*/
logging.SetLogLevel(f, l)
}
// IsLogLevel checks if given string is a valid log level.
func IsLogLevel(s string) bool {
for _, level := range []string{"DEBUG", "CRITICAL", "ERROR", "WARNING", "NOTICE", "INFO"} {
if strings.ToUpper(s) == level {
return true
}
}
return false
}