@@ -143,26 +143,37 @@ func TimeTrack(start time.Time, name string) {
143143
144144// LogFunctionStart log function start if debug is enabled
145145func LogFunctionStart () {
146+ LogFunctionStarts ("" )
147+ }
148+
149+ // LogFunctionStart log function start if debug is enabled
150+ func LogFunctionStarts (info string ) {
146151 if ! debugEnabled {
147152 return
148153 }
149154 pc , _ , _ , ok := runtime .Caller (1 )
150155 details := runtime .FuncForPC (pc )
151156 if ok && details != nil {
152- Log .Debugf ("Entering %s())" , details .Name ())
157+ Log .Debugf ("Entering %s()) %s " , details .Name (), info )
153158 }
154159}
155160
156161// LogFunctionEnd log function end if debug is enabled
157162// Usage: defer LogFunctionEnd(time.Now())
158163func LogFunctionEnd (start time.Time ) {
164+ LogFunctionEnds (start , "" )
165+ }
166+
167+ // LogFunctionEnd log function end if debug is enabled
168+ // Usage: defer LogFunctionEnd(time.Now())
169+ func LogFunctionEnds (start time.Time , info string ) {
159170 if ! debugEnabled {
160171 return
161172 }
162173 pc , _ , _ , ok := runtime .Caller (1 )
163174 details := runtime .FuncForPC (pc )
164175 if ok && details != nil {
165176 elapsed := time .Since (start )
166- Log .Debugf ("Leaving %s() tooks %s ms" , details .Name (), elapsed )
177+ Log .Debugf ("Leaving %s() %s tooks %s ms" , details .Name (), info , elapsed )
167178 }
168179}
0 commit comments