Questions tagged [oslog]
41 questions
3
votes
1 answer
Swift macOS App - Enable Info/Debug Logging in Apple Console App
Implemented Apples unified logging system.
let logger = Logger(subsystem: "com.myapp.test", category: "someCategory")
I am trying to make the logging visible in Apples Console App, but it does not work for Info/ Debug Levels.
logger.info("Info…

flymg
- 549
- 3
- 19
3
votes
1 answer
OSLog Logger doesn't work on XCode Playground: Couldn't lookup symbols: ___dso_handle
I want to test new iOS 14 Logger in Playground but I found next issue:
// MyLog.playground
import os
let logger = Logger()
logger.log("Hello OSLog")
Outputs:
error: Couldn't lookup symbols:
___dso_handle
___dso_handle
The same I have with…

iUrii
- 11,742
- 1
- 33
- 48
3
votes
1 answer
How to add different loggers (output destination like files and Crashlytics) for logs created by oslog?
Right now if I change the path of the stddr then my logs won't be going to the console anymore and they would only be going to the log files.
I'm wondering if there is a simple way that I can have them both?
Also is there anyway that I can pass…

mfaani
- 33,269
- 19
- 164
- 293
2
votes
1 answer
OSLogStore location
I'm trying to use the new OSLogStore object to retrieve created logs. It's very common to see the scope initialiser used like OSLogStore(scope: .currentProcessIdentifier). This works fine as long as I don't kill the app, but when I do, I cannot…

Bram
- 2,718
- 1
- 22
- 43
2
votes
1 answer
xcodebuild does not show output from OSLog in debug level
I am using xcodebuild to test my application in CI. I invoke it like this:
xcodebuild test -project myapp.xcodeproj -scheme myappTests -destination 'platform=iOS Simulator,name=iPhone 8,OS=14.4'
Text logged with the Logger from OSLog are not shown…

J. Doe
- 12,159
- 9
- 60
- 114
2
votes
1 answer
Access logs captured with os_log from within the iOS app
As of 2021, is it possible to access the logs captured with the os_log within the iOS app programmatically, for example, to send the log archive over the network?
On the page I've linked, there is a line:
You can also access log messages…

Richard Topchii
- 7,075
- 8
- 48
- 115
2
votes
1 answer
os_log Debug & Release Builds
I'm using the following helper method with OS_Log, but I'm not sure if it's necessary.
I want to log things in my Debug builds, but not(necessarily) in my Release builds.
I'm confused as to whether the compiler removes os_log statements in Release…

Chris
- 2,739
- 4
- 29
- 57
2
votes
1 answer
How to P/Invoke os_log?
What should the syntax be to call the MacOS' os_log from C# in a .NET Core console app?
Based on
https://developer.apple.com/documentation/os/os_log
and
How to use iOS OSLog with…

Jacek Kołodziejek
- 328
- 1
- 14
2
votes
0 answers
How can I view os_log log entries as they stream from a device using the log tool?
This is a question about Apple’s unified logging and activity tracing system, sometimes known as os_log.
I have an app that will not run in the simulator, but only on device. I want to use os_log to emit logs. I want to view the live stream of logs,…

algal
- 27,584
- 13
- 78
- 80
1
vote
0 answers
How to use private OSLogMessage in iOS Swift Logger library?
I was working on Logging on to iOS and decided to learn more about Logger structure in iOS, started with Apple Official Documentation which is quite well, and after watched WWDC 2020 video about Logging, the problem is that I could not achieve to…

eemrah
- 1,603
- 3
- 19
- 37
1
vote
0 answers
How to retrieve os_log messages from detached hard drive?
My daemon and application generated log messages using os_log(). Unfortunately the Mac mini running macOS Big Sur is no longer running as it always goes to the bootcamp partition when restarted. Now that hard drive has been removed from the Mini and…

recomp
- 11
- 5
1
vote
2 answers
Disable iOS OSLog on release build
I want to disable OSLog for my iOS app (release build). I am not using OSLog in my app but I still see some logs in the console app logged by the apple frameworks (like libnetwork, Corefoundation, SystemConfiguration etc.,). Is there is a way to…

karthik
- 1,271
- 1
- 14
- 27
1
vote
1 answer
Does the os_log Instrument expose messages unavailable in the Console?
On Xcode 11.6, I've learned that the Instruments app includes an "os_log" instrument, which reveals some possibly very helpful information for debugging CoreML models. When I run inference on a CoreML model on macOS, I can see logging from the…

algal
- 27,584
- 13
- 78
- 80
1
vote
0 answers
How to store Logs from AppleWatch even if the AppleWatch is not connected to a Mac
I am trying to store the Logs from the App I wrote (Apple Watch only, Swift/SwiftUI) to access them later, as soon as I connect my iPhone to my Mac.
Is there any possibility to store the Logs on the AppleWatch or iPhone throughout the day and access…

3xypn0s
- 80
- 6
1
vote
0 answers
OSLog write struct values and plot logs to a file
I have two questions about logging using OSLog lib.
I used to use log4j and similar logging libraries and now i'm confusing with OSLog.
I have a struct called coord with x and y vars inside it. I can plot it directly using print but cannot add it…

Jorge Vega Sánchez
- 7,430
- 14
- 55
- 77