Denmaseno 9 years ago
parent
commit
9ae26e9e58
1 changed files with 18 additions and 0 deletions
  1. 18 0
      log.go

+ 18 - 0
log.go

@@ -157,3 +157,21 @@ func Errorf(format string, a ...interface{}) {
 		fmt.Fprintf(os.Stderr, "ERROR: %s %v:%v: %s\n", time.Now().Format("01:04:05.000"), file, line, fmt.Sprintf(format, dump(a...)...))
 	}
 }
+
+// RError log
+func RError(a ...interface{}) {
+	if level <= ERROR {
+		_, path, line, _ := runtime.Caller(2)
+		_, file := filepath.Split(path)
+		fmt.Fprintf(os.Stderr, "ERROR: %s %v:%v: %s\n", time.Now().Format("01:04:05.000"), file, line, fmt.Sprint(dump(a...)...))
+	}
+}
+
+// RErrorf log
+func RErrorf(format string, a ...interface{}) {
+	if level <= ERROR {
+		_, path, line, _ := runtime.Caller(2)
+		_, file := filepath.Split(path)
+		fmt.Fprintf(os.Stderr, "ERROR: %s %v:%v: %s\n", time.Now().Format("01:04:05.000"), file, line, fmt.Sprintf(format, dump(a...)...))
+	}
+}