[Gambas-user] possible bug in gb. loggig

T Lee Davidson t.lee.davidson at gmail.com
Tue Sep 15 00:48:42 CEST 2020


On 9/14/20 3:51 AM, Angel wrote:
> It seems that the Formatter () function calls GetCallLocation ()
> 
> 
> Private Function GetCallLocation () As String
> 
> Dim iCount As Integer = 1
> 
> While System.Backtrace [iCount] Begins "Logger" Or System.Backtrace [iCount] Begins "Formatter"
> Inc iCount
> Wend
> 
> Return System.Backtrace [iCount]
> 
> End
> 
> When the Formatter () function is called from the ComplexLogger class, when the GetCallLocation () function is reached
> at some point System.Backtrace [iCount] has a value of "ComplexLogger.Log.60" and exits before reaching the function used by the 
> ComplexLogger class.
> 
> I would also like (if possible) the author to change the calls in Formatter () from Cstr () to Str () since curious errors can 
> occur if the format is $ (date) depending on the location.
> 

I'm wondering if perhaps that function should be:
Private Function GetCallLocation() As String

   Dim iCount As Integer = 1

   While System.Backtrace[iCount] Begins "ComplexLogger" Or System.Backtrace[iCount] Begins "Logger" Or System.Backtrace[iCount] 
Begins "Formatter"
     Inc iCount
   Wend

   Return System.Backtrace[iCount]

End


-- 
Lee


More information about the User mailing list