Clean up error/warning messages for consistency
Peter Borzov committed
Oct 9, 2014 at 11:48 UTC
8b90071478122f1a391bc912ff1baa319b8c70ab
3 files changed
+5
-4
cmd/ipfs/ipfs.go
+1
-1
@@ -126,7 +126,7 @@ func localNode(confdir string, online bool) (*core.IpfsNode, error) {
126
if cfg.Version.Check == config.CheckError {
127
return nil, obsolete
128
}
129
- fmt.Println(obsolete) // when "warn" version.check mode we just show warning message
129
+ log.Warning(fmt.Sprintf("%v", obsolete)) // when "warn" version.check mode we just show warning message
130
}
131
}
132
config/config.go
+2
-2
@@ -47,8 +47,8 @@ func (bp *BootstrapPeer) String() string {
47
48
// Version regulates checking if the most recent version is run
49
type Version struct {
50
- Check string `json:"check"` // "ignore" for do not check, "warn" and "error" for reacting when obsolete
51
- Current string `json:"current"` // ipfs version for which config was generated
50
+ Check string // "ignore" for do not check, "warn" and "error" for reacting when obsolete
51
+ Current string // ipfs version for which config was generated
52
}
53
54
const (
updates/updates.go
+2
-1
@@ -7,6 +7,7 @@ import (
7
"os"
8
9
"github.com/coreos/go-semver/semver"
10
+ u "github.com/jbenet/go-ipfs/util"
11
)
12
13
const (
@@ -34,7 +35,7 @@ func init() {
35
var err error
36
currentVersion, err = semver.NewVersion(Version)
37
if err != nil {
37
- fmt.Printf("The const Version literal in version.go needs to be in semver format: %s \n", Version)
38
+ u.PErr("The const Version literal in version.go needs to be in semver format: %s \n", Version)
39
os.Exit(1)
40
}
41
}