getLogLevelFromViper gets the chaincode container log levels from viper
(key string)
| 110 | |
| 111 | // getLogLevelFromViper gets the chaincode container log levels from viper |
| 112 | func getLogLevelFromViper(key string) string { |
| 113 | levelString := viper.GetString(key) |
| 114 | if !flogging.IsValidLevel(levelString) { |
| 115 | chaincodeLogger.Warningf("%s has invalid log level %s. defaulting to %s", key, levelString, flogging.DefaultLevel()) |
| 116 | levelString = flogging.DefaultLevel() |
| 117 | } |
| 118 | |
| 119 | return flogging.NameToLevel(levelString).String() |
| 120 | } |
| 121 | |
| 122 | // DevModeUserRunsChaincode enables chaincode execution in a development |
| 123 | // environment |