Page 1 of 1
Log LCB to Console.app or OSX terminal
Posted: Sat Jul 26, 2025 11:28 pm
by trevix
The subject tells it all.
In order to do a minimum debug of a LCB extension running on iOS hardware, I need to be able, in the .lcb file, to log some debug messages to the Console app or the Terminal, where I can filter and read them.
In the Console now I can already see a lot of messages from the iOS, also related to the test standalone, but none coming from the extension I am trying to build.
An example would be appreciated.
Thanks
Re: Log LCB to Console.app or OSX terminal
Posted: Mon Jul 28, 2025 7:41 am
by bn
Hi Trevix,
I used "log" while debugging LCB scripts with the built in display of LC when debugging and it displays the values in the debugger window of LC.
But looking at the dictionary for LCB it seems that you can "log" to console too.
But may be I am wrong.
Kind regards
Bernd
Re: Log LCB to Console.app or OSX terminal
Posted: Mon Jul 28, 2025 8:37 am
by trevix
I used "log" while debugging LCB scripts with the built in display of LC when debugging and it displays the values in the debugger window of LC.
I am not sure to understand. For "the debugger window of LC" you mean the msg window or the Livecode Extenion Builder Window?
What I found:
- the command "log" in the lcb does not reach the LCB window, nor the msg window
- console.app only gets iOS messages, not my personal log command of lcb. Useful but not so much given the verbosity
- while the adb logcat work well in the terminal for Android, I couldn't find a similar thing for iOS
On iOS I had to redirect all LCB messages to the LC message window, inserting this in the .lcb file (cumbersome):
Code: Select all
private handler IOSLog(in pMessage as String) returns nothing
if sCurrentPlatform is "ios" and sTarget is not nothing then
-- Send debug message to LiveCode script as a custom message
post "minewIOSDebugLog" to sTarget with [pMessage]
end if
-- Also use regular log for other platforms
log pMessage
end handler
But what a stress!
Can you confirm all this?
Re: Log LCB to Console.app or OSX terminal
Posted: Mon Jul 28, 2025 9:10 am
by bn
Hi Trevix,
I never used "log" in iOS or any other app, only in the IDE when debugging LCB widgets using the "Extension Builder".
Sorry to be of no help here. I just looked at the LCB-dictionary for "log" as well as in the LCS-dictionary for "log" and had the impression that the LCS "log" had the ability to be used on the supported platforms.
But the syntax description is confusing for me.
KInd regards
Bernd