Wish Log to Code

aaronk

Well-Known Member
Licensed User
Longtime User
Hi,

Not sure how easy this is to add or if this is even possible but a idea that come to mind is..

Currently the IDE lets you log things into the IDE log, but what if you wanted to know what function made it log that event. I know you can search for the Log keyword in the search, but a good idea come to mind, what if you Ctrl + Click the event in the IDE log and it took you to the line that wrote that log event in the IDE log.

Not sure if it's possible or not, but thought it would be a good idea and would make it even quicker to find the function (or code) that caused that event to be written.
 

DonManfred

Expert
Licensed User
Longtime User
You can surely create a sub in a codemodule which get the sub call as a parameter.
And ony in this sub you do the LOG itself. But with loggin the subname you gave to the sub...
B4X:
sub mylog(module as String, log As String)
log($"${module}: ${log}"$)
end sub

Edit: You also could add the time to the log if you want.
 

aaronk

Well-Known Member
Licensed User
Longtime User
Good idea, but was more hoping to click the log event in the IDE and for it to take you to the line of code.

Code you provided might work for now.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…