|
@@ -37,15 +37,15 @@ func InitLog(path string, showstdout string) error {
|
|
}
|
|
}
|
|
|
|
|
|
func PageCntErr(index string, tablename string) string {
|
|
func PageCntErr(index string, tablename string) string {
|
|
- return LogStr(index, " Count Query Error "+tablename+" ")
|
|
|
|
|
|
+ return ErrStr(index, " Count Query Error "+tablename+" ")
|
|
}
|
|
}
|
|
|
|
|
|
func PageRead(index string, tablename string) string {
|
|
func PageRead(index string, tablename string) string {
|
|
- return LogStr(index, " Page Read from "+tablename+" ")
|
|
|
|
|
|
+ return ErrStr(index, " Page Read from "+tablename+" ")
|
|
}
|
|
}
|
|
|
|
|
|
func PageQryErr(index string, tablename string) string {
|
|
func PageQryErr(index string, tablename string) string {
|
|
- return LogStr(index, " Page Query Error "+tablename+" ")
|
|
|
|
|
|
+ return ErrStr(index, " Page Query Error "+tablename+" ")
|
|
}
|
|
}
|
|
|
|
|
|
func RecRead(index string, msgString string) string {
|
|
func RecRead(index string, msgString string) string {
|
|
@@ -57,7 +57,7 @@ func RecNotFound(index string, msgString string) string {
|
|
}
|
|
}
|
|
|
|
|
|
func RecReadErr(index string, msgString string) string {
|
|
func RecReadErr(index string, msgString string) string {
|
|
- return LogStr(index, " B error in Reading "+msgString+" ")
|
|
|
|
|
|
+ return ErrStr(index, " B error in Reading "+msgString+" ")
|
|
}
|
|
}
|
|
|
|
|
|
func RecAdded(index string, msgString string) string {
|
|
func RecAdded(index string, msgString string) string {
|
|
@@ -69,7 +69,7 @@ func RecNotAdded(index string, msgString string) string {
|
|
}
|
|
}
|
|
|
|
|
|
func RecAddErr(index string, msgString string) string {
|
|
func RecAddErr(index string, msgString string) string {
|
|
- return LogStr(index, " DB error in Adding "+msgString+" ")
|
|
|
|
|
|
+ return ErrStr(index, " DB error in Adding "+msgString+" ")
|
|
}
|
|
}
|
|
|
|
|
|
func RecEdited(index string, msgString string) string {
|
|
func RecEdited(index string, msgString string) string {
|
|
@@ -81,7 +81,7 @@ func RecNotEdited(index string, msgString string) string {
|
|
}
|
|
}
|
|
|
|
|
|
func RecEditErr(index string, msgString string) string {
|
|
func RecEditErr(index string, msgString string) string {
|
|
- return LogStr(index, " DB error in Editing "+msgString+" ")
|
|
|
|
|
|
+ return ErrStr(index, " DB error in Editing "+msgString+" ")
|
|
}
|
|
}
|
|
|
|
|
|
func RecDeleted(index string, msgString string) string {
|
|
func RecDeleted(index string, msgString string) string {
|
|
@@ -97,15 +97,23 @@ func RecDelErr(index string, msgString string) string {
|
|
}
|
|
}
|
|
|
|
|
|
func FuncRun(index string, funcname string) string {
|
|
func FuncRun(index string, funcname string) string {
|
|
- return LogStr(index, " Function Run from "+funcname+" ")
|
|
|
|
|
|
+ return LogStr(index, " Func : "+funcname+" ")
|
|
}
|
|
}
|
|
|
|
|
|
func FuncRunErr(index string, funcname string) string {
|
|
func FuncRunErr(index string, funcname string) string {
|
|
- return LogStr(index, " Function Run Error in "+funcname+" ")
|
|
|
|
|
|
+ return ErrStr(index, " Func->"+funcname+" ")
|
|
}
|
|
}
|
|
|
|
|
|
func JsonFormatErr(index string, structname string) string {
|
|
func JsonFormatErr(index string, structname string) string {
|
|
- return LogStr(index, " Json Format mismatches in "+structname+" ")
|
|
|
|
|
|
+ return ErrStr(index, " Json Format mismatches in "+structname+" ")
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func ErrStr(index string, s string) string { // nㅣl 아님 경우만 처리(!!중요)
|
|
|
|
+ msg := s
|
|
|
|
+ str := index + " @ " + msg
|
|
|
|
+ log.Println("[Err]: " + str)
|
|
|
|
+
|
|
|
|
+ return msg
|
|
}
|
|
}
|
|
|
|
|
|
func LogStr(index string, s string) string { // nㅣl 아님 경우만 처리(!!중요)
|
|
func LogStr(index string, s string) string { // nㅣl 아님 경우만 처리(!!중요)
|
|
@@ -125,7 +133,7 @@ func LogErr(index string, s string, err error) error { // nㅣl 아님 경우만
|
|
}
|
|
}
|
|
msg := s + " * " + errStr
|
|
msg := s + " * " + errStr
|
|
str := index + " @ " + msg
|
|
str := index + " @ " + msg
|
|
- log.Println("[Cnd]: " + str)
|
|
|
|
|
|
+ log.Println("[Err]: " + str)
|
|
return errors.New(msg)
|
|
return errors.New(msg)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -134,9 +142,9 @@ func CurrFuncName() string { // nㅣl 아님 경우만 처리(!!중요)
|
|
n := runtime.Callers(2, pc)
|
|
n := runtime.Callers(2, pc)
|
|
frames := runtime.CallersFrames(pc[:n])
|
|
frames := runtime.CallersFrames(pc[:n])
|
|
frame, _ := frames.Next()
|
|
frame, _ := frames.Next()
|
|
|
|
+ fmt.Printf("ErrPath: %s:%d %s\n", frame.File, frame.Line, frame.Function)
|
|
|
|
+ // fmt.Println("Lastindex:", s[strings.LastIndex(s, "/")+1:])
|
|
s := frame.Function
|
|
s := frame.Function
|
|
- // fmt.Println(s[strings.LastIndex(s, "/")+1:])
|
|
|
|
- // fmt.Printf("%s:%d %s\n", frame.File, frame.Line, frame.Function)
|
|
|
|
return s[strings.LastIndex(s, "/")+1:] + " "
|
|
return s[strings.LastIndex(s, "/")+1:] + " "
|
|
}
|
|
}
|
|
|
|
|