aboutsummaryrefslogtreecommitdiffstats
path: root/errs
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2017-01-06 23:55:03 +0800
committerFelix Lange <fjl@twurst.com>2017-01-07 01:18:07 +0800
commit13e3b2f433c48fe81423c1a13e9a5194ece61b01 (patch)
tree19ff7c32597a41bbfe7ccc0d32ecaed05d0e6132 /errs
parentf2da6581ba827a2aab091f764ace8017b26450d8 (diff)
downloaddexon-13e3b2f433c48fe81423c1a13e9a5194ece61b01.tar.gz
dexon-13e3b2f433c48fe81423c1a13e9a5194ece61b01.tar.zst
dexon-13e3b2f433c48fe81423c1a13e9a5194ece61b01.zip
logger, pow/dagger, pow/ezp: delete dead code
Diffstat (limited to 'errs')
-rw-r--r--errs/errors.go22
-rw-r--r--errs/errors_test.go21
2 files changed, 0 insertions, 43 deletions
diff --git a/errs/errors.go b/errs/errors.go
index 675649efa..daa814db7 100644
--- a/errs/errors.go
+++ b/errs/errors.go
@@ -19,7 +19,6 @@ package errs
import (
"fmt"
- "github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
)
@@ -32,15 +31,10 @@ Fields:
Package:
name of the package/component
-
- Level:
- a function mapping error code to logger.LogLevel (severity)
- if not given, errors default to logger.InfoLevel
*/
type Errors struct {
Errors map[int]string
Package string
- Level func(code int) logger.LogLevel
}
/*
@@ -58,7 +52,6 @@ type Error struct {
Code int
Name string
Package string
- level logger.LogLevel
message string
format string
params []interface{}
@@ -69,15 +62,10 @@ func (self *Errors) New(code int, format string, params ...interface{}) *Error {
if !ok {
panic("invalid error code")
}
- level := logger.InfoLevel
- if self.Level != nil {
- level = self.Level(code)
- }
return &Error{
Code: code,
Name: name,
Package: self.Package,
- level: level,
format: format,
params: params,
}
@@ -98,13 +86,3 @@ func (self Error) Log(v glog.Verbose) {
v.Infoln(self)
}
}
-
-/*
-err.Fatal() is true if err's severity level is 0 or 1 (logger.ErrorLevel or logger.Silence)
-*/
-func (self *Error) Fatal() (fatal bool) {
- if self.level < logger.WarnLevel {
- fatal = true
- }
- return
-}
diff --git a/errs/errors_test.go b/errs/errors_test.go
index d6d14b45e..5a2ffbec3 100644
--- a/errs/errors_test.go
+++ b/errs/errors_test.go
@@ -19,8 +19,6 @@ package errs
import (
"fmt"
"testing"
-
- "github.com/ethereum/go-ethereum/logger"
)
func testErrors() *Errors {
@@ -30,14 +28,6 @@ func testErrors() *Errors {
0: "zero",
1: "one",
},
- Level: func(i int) (l logger.LogLevel) {
- if i == 0 {
- l = logger.ErrorLevel
- } else {
- l = logger.WarnLevel
- }
- return
- },
}
}
@@ -49,14 +39,3 @@ func TestErrorMessage(t *testing.T) {
t.Errorf("error message incorrect. expected %v, got %v", exp, message)
}
}
-
-func TestErrorSeverity(t *testing.T) {
- err0 := testErrors().New(0, "zero detail")
- if !err0.Fatal() {
- t.Errorf("error should be fatal")
- }
- err1 := testErrors().New(1, "one detail")
- if err1.Fatal() {
- t.Errorf("error should not be fatal")
- }
-}