I’m running OS X High Sierra and the console app has become a real pain in the backside. I am having problems using it to do any sort of decent debug logging. Yes, I can filter for my app name, but there is now a TON of stuff showing up that is OS related or must be to my app. Here’s an example:
debug 09:41:55.511832 -0500 MediaSwitcher Bundle: <private>, key: Err306, value: There was a problem communicating with the web proxy server (HTTP)., table: Localizable, localizationName: (null), result: There was a problem communicating with the web proxy server (HTTP).
debug 09:41:55.511882 -0500 MediaSwitcher Bundle: <private>, key: Please check your proxy settings. For help with this problem, contact your system administrator., value: Please check your proxy settings. For help with this problem, contact your system administrator., table: Localizable, localizationName: (null), result: Please check your proxy settings. For help with this problem, contact your system administrator.
info 09:41:55.511892 -0500 MediaSwitcher nw_endpoint_flow_protocol_disconnected [3.1 75.146.116.250:80 cancelled socket-flow (null)] Output protocol disconnected
debug 09:41:55.511921 -0500 MediaSwitcher Bundle: <private>, key: Err310, value: There was a problem communicating with the secure web proxy server (HTTPS)., table: Localizable, localizationName: (null), result: There was a problem communicating with the secure web proxy server (HTTPS).
None of that is mine. And I have no idea what web proxy server it says I am trying to use, etc. There is so much junk like this that just rolls through and I am having a hard time finding my System.Debuglog statements in it. Console never used to be like this.
Is there a way to shut all the rest of this stuff off?
[quote=383557:@Thomas Eckert]Use the terminal and filter for your app name, only e.g.
tail -f /var/log/system.log | grep MyAppName
You’re better off using log stream --process MyAppName. It’s going to be much more efficient and the --predicate option can be used to help filter the data further.
I stopped using the console log a long long time ago (like 5 minutes after I first tried it)
today I have a “debug” method that I drop into my programs when required…
its not pretty, but then it has a temporary job to do
it streams the messages to a file on my desktop… no filtering… and its actually FASTER than the console log
Public Sub debug(msg As String,force as Boolean=false)
//return
Dim f As FolderItem
Dim t As TextOutputStream
f=get_Folder_Root.child("rapid.trace_log")
If msg="!!!" Then
If f.exists Then f.delete
Exit Sub
End If
//
#If DebugBuild Then
force=True
#EndIf
If force Then
If Not f.exists Then
t=TextOutputStream.Create(f)
Else
t=TextOutputStream.Append(f)
End If
t.write Str(Ticks)+":"+msg+EndOfLine
t.close
End If
End Sub
(From memory): Open Console.app, make the sidebar visible (Show Source), click System.Log, and then enter a search term in the search field. It helps if the search term is unique, such as “MyApp”. Test that it works. A small “Save” button will appear and you can save this filter on the toolbar.
Edit: I think you have to use System.DebugLog(msg) to get it to show up.
Possibly related question: In a Xojo app using a HTMLViewer, is there a way for console.warning or console.error messages inside the HTML/Javascript content of that HTMLViewer to be displayed?