[Gambas-user] Logger $(callLocation) always prints ComplexLogger.Log.60

T Lee Davidson t.lee.davidson at gmail.com
Tue Dec 21 21:30:53 CET 2021


On 12/21/21 9:43 AM, Cristiano Guadagnino wrote:
> Hi,
> I am beginning to use the logging functions provided by gb.logging.
> Unfortunately I found that, when using $(callLocation), the log always contains "ComplexLogger.Log.60". This is not very useful.
> I did a search before posting this thread, and found an identical thread from 2018 which, however, did not contain any reply.
> 
> I can add some code if needed, but I'm not doing anything special.
> I just instantiate a new Logger object, then use it, leaving most values (especially Format) to their defaults.
> 
> Thank you in advance for your help
> Cris
> cloudHQ <https://www.free-email-tracker.com>	Powered by
> cloudHQ <https://www.free-email-tracker.com>	
> 

I think it's a bug.

The function that populates the call location is in the Formatter Module [1] starting at line 7:
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

I think that While statement should be:
While System.Backtrace[iCount] Begins "Log" Or System.Backtrace[iCount] Begins "Formatter"


-- 
Lee

[1] https://gitlab.com/gambas/gambas/-/blob/master/comp/src/gb.logging/.src/Formatter.module



More information about the User mailing list