Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
The code in core/config.go has no call path, remove this dead code.

Change-Id: Ic2adbc0b6cebfb56e663ad00a40eccddb14044ae
Signed-off-by: grapebaba <281165273@qq.com>
  • Loading branch information
GrapeBaBa authored and gaborh-da committed Aug 29, 2016
1 parent a087441 commit 7c870f3
Showing 1 changed file with 0 additions and 54 deletions.
54 changes: 0 additions & 54 deletions core/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,64 +17,10 @@ limitations under the License.
package core

import (
"flag"
"fmt"
"runtime"
"strings"

"github.com/op/go-logging"
"github.com/spf13/viper"
)

// Config the config wrapper structure
type Config struct {
}

func init() {

}

// SetupTestLogging setup the logging during test execution
func SetupTestLogging() {
level, err := logging.LogLevel(viper.GetString("peer.logging.level"))
if err == nil {
// No error, use the setting
logging.SetLevel(level, "main")
logging.SetLevel(level, "server")
logging.SetLevel(level, "peer")
} else {
log.Warningf("Log level not recognized '%s', defaulting to %s: %s", viper.GetString("peer.logging.level"), logging.ERROR, err)
logging.SetLevel(logging.ERROR, "main")
logging.SetLevel(logging.ERROR, "server")
logging.SetLevel(logging.ERROR, "peer")
}
}

// SetupTestConfig setup the config during test execution
func SetupTestConfig() {
flag.Parse()

// Now set the configuration file
viper.SetEnvPrefix("HYPERLEDGER")
viper.AutomaticEnv()
replacer := strings.NewReplacer(".", "_")
viper.SetEnvKeyReplacer(replacer)
viper.SetConfigName("core") // name of config file (without extension)
viper.AddConfigPath("./") // path to look for the config file in
viper.AddConfigPath("./../") // path to look for the config file in
err := viper.ReadInConfig() // Find and read the config file
if err != nil { // Handle errors reading the config file
panic(fmt.Errorf("Fatal error config file: %s \n", err))
}

SetupTestLogging()

// Set the number of maxprocs
var numProcsDesired = viper.GetInt("peer.gomaxprocs")
log.Debugf("setting Number of procs to %d, was %d\n", numProcsDesired, runtime.GOMAXPROCS(2))

}

// See fabric/core/peer/config.go for comments on the configuration caching
// methodology.

Expand Down

0 comments on commit 7c870f3

Please sign in to comment.