Skip to content

Commit c35264d

Browse files
committed
log: upto 9 callers in the stack
1 parent d02af5f commit c35264d

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

intra/log/logger.go

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -676,20 +676,29 @@ func (l *simpleLogger) writelog(lvl LogLevel, at int, msg string, args ...any) {
676676
}
677677

678678
if ll || cc {
679-
_, x, _ := callers(at+nextframe, 7, ":", "@")
679+
_, x, _ := callers(at+nextframe, 9, ":", "@")
680680
switch lvl {
681681
case USR, STACKTRACE, NONE: // no-op
682682
case VVERBOSE:
683-
if len(x) >= 7 && tracecaller(x[6]) {
684-
trace += x[6] + ">"
683+
if len(x) >= 10 && tracecaller(x[9]) {
684+
trace += x[9] + ">"
685685
}
686686
fallthrough
687687
case VERBOSE:
688-
if len(x) >= 6 && tracecaller(x[5]) {
689-
trace += x[5] + ">"
688+
if len(x) >= 9 && tracecaller(x[8]) {
689+
trace += x[8] + ">"
690690
}
691691
fallthrough
692692
case DEBUG, ERROR, WARN, INFO:
693+
if len(x) >= 8 && tracecaller(x[7]) {
694+
trace += x[7] + ">"
695+
}
696+
if len(x) >= 7 && tracecaller(x[6]) {
697+
trace += x[6] + ">"
698+
}
699+
if len(x) >= 6 && tracecaller(x[5]) {
700+
trace += x[5] + ">"
701+
}
693702
if len(x) >= 5 && tracecaller(x[4]) {
694703
trace += x[4] + ">"
695704
}

0 commit comments

Comments
 (0)