(f *runtime.Func)
| 420 | } |
| 421 | |
| 422 | func FuncName(f *runtime.Func) string { |
| 423 | name := f.Name() |
| 424 | idx := strings.LastIndexByte(name, '/') |
| 425 | if idx != -1 { |
| 426 | name = name[idx:] |
| 427 | idx = strings.IndexByte(name, '.') |
| 428 | if idx != -1 { |
| 429 | name = strings.TrimPrefix(name[idx:], ".") |
| 430 | } |
| 431 | } |
| 432 | return name |
| 433 | } |
| 434 | |
| 435 | // FlushLogger flush all log to disk. |
| 436 | func FlushLogger() { |