Browse Source

241103-2257-Kim

EricKIm 2 weeks ago
parent
commit
f0a2163e68
2 changed files with 15 additions and 27 deletions
  1. 5 27
      etc/err-log.go
  2. 10 0
      etc/string.go

+ 5 - 27
etc/err-log.go

@@ -145,7 +145,7 @@ func CurrFuncName() string { // nil 아닌 경우만 처리(!!중요)
 	fmt.Printf("FuncPath: %s:%d %s\n", frame.File, frame.Line, frame.Function)
 	// fmt.Println("Lastindex:", s[strings.LastIndex(s, "/")+1:])
 	s := frame.Function
-	return s[strings.LastIndex(s, "/")+1:] + " "
+	return s[strings.LastIndex(s, "/")+1:] + "\n"
 }
 
 func LogFuncName() string {
@@ -214,20 +214,12 @@ func ErrLog(s string, err error) error { // // nㅣl처리 아주 중요함 ( 
 	str := "[Err]: " + s + " (Err): " + errStr
 	log.Println(str)
 	return errors.New(str)
-
 }
 
-// === 여기 까지 =====
-
 func ChkLog(point string, x ...interface{}) {
 	log.Println("[CHECK:" + point + "] " + fmt.Sprintf("%v", x))
 }
 
-// func FatalLog(point string, err error) {
-// 	fmt.Println("[FATAL-ERROR]: "+point, err)
-// 	os.Exit(1000)
-// }
-
 func MyErr(s string, e error, eout bool) error {
 	fmt.Println("[MyErr] Position -> ", s, strings.Repeat("=", 40))
 
@@ -250,14 +242,6 @@ func MyErr(s string, e error, eout bool) error {
 	return errors.New(emsg)
 }
 
-func Tp(a ...interface{}) {
-	fmt.Println(a)
-}
-
-func Atp(a ...interface{}) {
-	fmt.Println("[Abango]->", a)
-}
-
 func agErr(s string, e error, amsg *string) string {
 	fmt.Println("== agErr ", strings.Repeat("=", 90))
 	// fpcs := make([]uintptr, 1)
@@ -285,7 +269,7 @@ func agErr(s string, e error, amsg *string) string {
 
 func whereami(i int) {
 	function, file, line, _ := runtime.Caller(i)
-	fmt.Printf("  %d.File: %s - %d  %s\n   func: %s \n", i, chopPath(file), line, file, runtime.FuncForPC(function).Name())
+	fmt.Printf("  %d.File: %s - %d  %s\n   func: %s \n", i, ChopPath(file), line, file, runtime.FuncForPC(function).Name())
 }
 
 func WhereAmI(depthList ...int) {
@@ -301,19 +285,13 @@ func WhereAmI(depthList ...int) {
 
 		function, file, line, _ := runtime.Caller(i)
 		fmt.Printf("==Level %d==\n", i)
-		fmt.Printf("File: %s - %d  %s\nFunction: %s \n", chopPath(file), line, file, runtime.FuncForPC(function).Name())
+		fmt.Printf("File: %s - %d  %s\nFunction: %s \n", ChopPath(file), line, file, runtime.FuncForPC(function).Name())
 	}
 	fmt.Printf("==End==\n")
 
 	return
 }
 
-// return the source filename after the last slash
-func chopPath(original string) string {
-	i := strings.LastIndex(original, "/")
-	if i == -1 {
-		return original
-	} else {
-		return original[i+1:]
-	}
+func QryPathNSql(path string, sql string) string { // // nㅣl처리 아주 중요함 ( 이건 이제 더 사용하지 말것)
+	return "====" + path + "====\n" + sql + "\n" + "===================\n"
 }

+ 10 - 0
etc/string.go

@@ -163,3 +163,13 @@ func FileNameFromPath(input string) string {
 	parts := strings.Split(result, "/")
 	return parts[len(parts)-1]
 }
+
+// return the source filename after the last slash
+func ChopPath(original string) string {
+	i := strings.LastIndex(original, "/")
+	if i == -1 {
+		return original
+	} else {
+		return original[i+1:]
+	}
+}