diff --git a/comp/src/gb.logging/.src/Formatter.module b/comp/src/gb.logging/.src/Formatter.module index 734501bd2..7e6f9f20b 100644 --- a/comp/src/gb.logging/.src/Formatter.module +++ b/comp/src/gb.logging/.src/Formatter.module @@ -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 diff --git a/comp/src/gb.logging/.src/MTest.module b/comp/src/gb.logging/.src/MTest.module index dd9a7d663..bfd9cbd6d 100644 --- a/comp/src/gb.logging/.src/MTest.module +++ b/comp/src/gb.logging/.src/MTest.module @@ -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()