remove utils.PErr()

This commit is contained in:
Henry 2014-10-14 09:52:24 +02:00
parent 2ed154bd71
commit 98d9df544f
3 changed files with 3 additions and 9 deletions

View File

@ -43,7 +43,7 @@ func printRefs(n *core.IpfsNode, nd *mdag.Node, refSeen map[u.Key]bool, recursiv
if recursive {
nd, err := n.DAG.Get(u.Key(link.Hash))
if err != nil {
u.PErr("error: cannot retrieve %s (%s)\n", link.Hash.B58String(), err)
log.Error("error: cannot retrieve %s (%s)\n", link.Hash.B58String(), err)
return
}

View File

@ -37,7 +37,7 @@ func init() {
var err error
currentVersion, err = semver.NewVersion(Version)
if err != nil {
u.PErr("The const Version literal in version.go needs to be in semver format: %s \n", Version)
log.Error("The const Version literal in version.go needs to be in semver format: %s \n", Version)
os.Exit(1)
}
}

View File

@ -17,11 +17,6 @@ var LogFormat = "%{color}%{time:2006-01-02 15:04:05.999999} %{shortfile} %{level
// loggers is the set of loggers in the system
var loggers = map[string]*logging.Logger{}
// PErr is a shorthand printing function to output to Stderr.
func PErr(format string, a ...interface{}) {
fmt.Fprintf(os.Stderr, format, a...)
}
// POut is a shorthand printing function to output to Stdout.
func POut(format string, a ...interface{}) {
fmt.Fprintf(os.Stdout, format, a...)
@ -39,8 +34,7 @@ func SetupLogging() {
if logenv := os.Getenv("IPFS_LOGGING"); logenv != "" {
lvl, err = logging.LogLevel(logenv)
if err != nil {
PErr("invalid logging level: %s\n", logenv)
PErr("using logging.DEBUG\n")
log.Error("invalid logging level: %s\n", logenv)
lvl = logging.DEBUG
}
}