[GB.LOGGING]
* BUG: Fix the detection of the call location. git-svn-id: svn://localhost/gambas/trunk@6010 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
42a089eda6
commit
ca5b87fed3
2 changed files with 11 additions and 5 deletions
|
@ -6,25 +6,31 @@ Export
|
|||
|
||||
Private Function GetCallLocation() As String
|
||||
|
||||
Return System.Backtrace[3]
|
||||
Dim iCount As Integer = 3
|
||||
|
||||
While System.Backtrace[iCount] Begins "Logger"
|
||||
Inc iCount
|
||||
Wend
|
||||
|
||||
Return System.Backtrace[iCount]
|
||||
|
||||
End
|
||||
|
||||
Private Function GetCallFile() As String
|
||||
|
||||
Return Split(System.Backtrace[3], ".")[0]
|
||||
Return Split(GetCallLocation(), ".")[0]
|
||||
|
||||
End
|
||||
|
||||
Private Function GetCallFunction() As String
|
||||
|
||||
Return Split(System.Backtrace[3], ".")[1]
|
||||
Return Split(GetCallLocation(), ".")[1]
|
||||
|
||||
End
|
||||
|
||||
Private Function GetCallLine() As String
|
||||
|
||||
Return Split(System.Backtrace[3], ".")[2]
|
||||
Return Split(GetCallLocation(), ".")[2]
|
||||
|
||||
End
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ Public Sub Main()
|
|||
|
||||
Dim a As Logger
|
||||
|
||||
a = New Logger '(Logger.Debug, Logger.DefaultFormat, User.Home)
|
||||
a = New Logger(Logger.Debug, "[$(now)] [$(levelname)] [$(callFunction)] $(message)")
|
||||
|
||||
a.Begin()
|
||||
|
||||
|
|
Loading…
Reference in a new issue