This was broken by 10a7328 because I misunderstood the subtlety that the "subroutine" parameter returned by caller(n) is the name of the subroutine that was called (i.e. the descendent), not the subroutine the frame was in. Thus, when I fixed up the caller call to find a frame whose subroutine was the one I expected, I found the wrong frame. So, although it now logs the calling subroutine correctly, it logs the incorrect line number with it.
This was broken by 10a7328 because I misunderstood the subtlety that the "subroutine" parameter returned by
caller(n)
is the name of the subroutine that was called (i.e. the descendent), not the subroutine the frame was in. Thus, when I fixed up the caller call to find a frame whose subroutine was the one I expected, I found the wrong frame. So, although it now logs the calling subroutine correctly, it logs the incorrect line number with it.