I'm trying to figure out how to maximize the value of structured logging in my project. The log filtering improvements in Xcode 15 are great but limited to being able to control the logging at a fine-grained level. For example, if I want to always disable some chatty debug logs for a specific category.
Setting OSLogPreference solves this problem once you've installed it onto a device, but when running in debug mode on Xcode, it seems to ignore this and print everything.
Is there a way to apply OSLogPreference while running Xcode, or another way to selectively disable categories?
Post
Replies
Boosts
Views
Activity
Afternoon Apple Fourms,I'm exploring the features of os_log for my team, and from reading the documentation and playing around an example project it seems to me that there isn't a support way to enable/disable log levels at all on iOS devices for subsystems or their categories The documentation suggest that there is a way to do this macOS using both a command line tool or by installing a plist:https://developer.apple.com/documentation/os/logging?language=objc"Logging behavior is normally governed by the system. However, while debugging in macOS, you can enable different logging levels for a subsystem using the log command-line tool’s config argument while logged in as root. See Listing 5, which shows how to enable debug-level logging for a subsystem.""You can also override the logging behavior of a specific subsystem by creating and installing a logging configuration profile property list file in the /Library/Preferences/Logging/Subsystems/ directory."To my knowledge, neither of these will work for iOS as you can't shell into the device, or install to the Library. Am I correct that there is no way to alert the configuration on the device? For example If I want debug logs for one category, but default on another?Ex Default-Options: Level:InfoCat1: Level:DebugCat2: Level:DefaultThanks.