2021-02-10 19:29:47 +00:00
|
|
|
package flog
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
2021-02-10 19:40:40 +00:00
|
|
|
"time"
|
2021-02-10 19:29:47 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func (receiver internalLogger) Begin(a ...interface{}) Logger {
|
|
|
|
|
|
|
|
var funcName string = "<([-UNKNOWN-])>"
|
|
|
|
{
|
|
|
|
pc, _, _, ok := runtime.Caller(1)
|
|
|
|
if ok {
|
|
|
|
fn := runtime.FuncForPC(pc)
|
|
|
|
funcName = fn.Name()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
logger := receiver.Prefix(funcName)
|
2021-02-10 19:40:40 +00:00
|
|
|
switch casted := logger.(type) {
|
|
|
|
case *internalLogger:
|
|
|
|
casted.begin = time.Now()
|
|
|
|
}
|
2021-02-10 19:29:47 +00:00
|
|
|
|
|
|
|
a = append([]interface{}{"BEGIN"}, a...)
|
|
|
|
|
|
|
|
logger.Debug(a...)
|
|
|
|
|
|
|
|
return logger
|
|
|
|
}
|