remove utils.PErr()
Henry committed
Oct 14, 2014 at 09:52 UTC
98d9df544f0ce3dc3cafd9d609b630c32fc35e12
3 files changed
+3
-9
core/commands/refs.go
+1
-1
@@ -43,7 +43,7 @@ func printRefs(n *core.IpfsNode, nd *mdag.Node, refSeen map[u.Key]bool, recursiv
43
if recursive {
44
nd, err := n.DAG.Get(u.Key(link.Hash))
45
if err != nil {
46
- u.PErr("error: cannot retrieve %s (%s)\n", link.Hash.B58String(), err)
46
+ log.Error("error: cannot retrieve %s (%s)\n", link.Hash.B58String(), err)
47
return
48
}
49
updates/updates.go
+1
-1
@@ -37,7 +37,7 @@ func init() {
37
var err error
38
currentVersion, err = semver.NewVersion(Version)
39
if err != nil {
40
- u.PErr("The const Version literal in version.go needs to be in semver format: %s \n", Version)
40
+ log.Error("The const Version literal in version.go needs to be in semver format: %s \n", Version)
41
os.Exit(1)
42
}
43
}
util/log.go
+1
-7
@@ -17,11 +17,6 @@ var LogFormat = "%{color}%{time:2006-01-02 15:04:05.999999} %{shortfile} %{level
17
// loggers is the set of loggers in the system
18
var loggers = map[string]*logging.Logger{}
19
20
-// PErr is a shorthand printing function to output to Stderr.
21
-func PErr(format string, a ...interface{}) {
22
- fmt.Fprintf(os.Stderr, format, a...)
23
-}
24
-
20
// POut is a shorthand printing function to output to Stdout.
21
func POut(format string, a ...interface{}) {
22
fmt.Fprintf(os.Stdout, format, a...)
@@ -39,8 +34,7 @@ func SetupLogging() {
34
if logenv := os.Getenv("IPFS_LOGGING"); logenv != "" {
35
lvl, err = logging.LogLevel(logenv)
36
if err != nil {
42
- PErr("invalid logging level: %s\n", logenv)
43
- PErr("using logging.DEBUG\n")
37
+ log.Error("invalid logging level: %s\n", logenv)
38
lvl = logging.DEBUG
39
}
40
}