mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-10 10:47:51 +08:00
remove utils.PErr()
This commit is contained in:
parent
2ed154bd71
commit
98d9df544f
@ -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
|
||||
}
|
||||
|
||||
|
||||
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user