Changed how changes are being applied to states

This commit is contained in:
obscuren
2014-05-17 14:07:52 +02:00
parent 88686cbed2
commit 8730dfdcc2
10 changed files with 82 additions and 98 deletions

View File

@ -9,14 +9,6 @@ import (
"runtime"
)
// Log types available
type LogType byte
const (
LogTypeStdIn = 1
LogTypeFile = 2
)
// Config struct
type config struct {
Db Database
@ -34,7 +26,7 @@ var Config *config
// Read config
//
// Initialize the global Config variable with default settings
func ReadConfig(base string) *config {
func ReadConfig(base string, logTypes LoggerType) *config {
if Config == nil {
usr, _ := user.Current()
path := path.Join(usr.HomeDir, base)
@ -51,7 +43,7 @@ func ReadConfig(base string) *config {
}
Config = &config{ExecPath: path, Debug: true, Ver: "0.5.0 RC6"}
Config.Log = NewLogger(LogFile|LogStd, LogLevelDebug)
Config.Log = NewLogger(logTypes, LogLevelDebug)
Config.SetClientString("/Ethereum(G)")
}