Denmaseno 9 سال پیش
والد
کامیت
9ae26e9e58
1فایلهای تغییر یافته به همراه18 افزوده شده و 0 حذف شده
  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...)...))
+	}
+}