Log LCB to Console.app or OSX terminal

LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.

Moderators: LCMark, LCfraser

Post Reply
trevix
Posts: 1067
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

Log LCB to Console.app or OSX terminal

Post by trevix » Sat Jul 26, 2025 11:28 pm

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
Trevix
OSX 14.6.1 xCode 15 LC 10 RC1 iOS 15> Android 7>

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4168
Joined: Sun Jan 07, 2007 9:12 pm

Re: Log LCB to Console.app or OSX terminal

Post by bn » Mon Jul 28, 2025 7:41 am

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

trevix
Posts: 1067
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

Re: Log LCB to Console.app or OSX terminal

Post by trevix » Mon Jul 28, 2025 8:37 am

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?
Trevix
OSX 14.6.1 xCode 15 LC 10 RC1 iOS 15> Android 7>

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4168
Joined: Sun Jan 07, 2007 9:12 pm

Re: Log LCB to Console.app or OSX terminal

Post by bn » Mon Jul 28, 2025 9:10 am

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

Post Reply