I'm using the unified logging API in my iOS app.
import os
private let log = OSLog(subsystem: "", category: "ThisComponent")
...
os_log(.debug, log:log, "Blah blah blah: %@", str)
Those debug log calls show up in the Xcode console when running my app. Once I'm no longer focused on a particular component, I don't want to see its flood of debug level log messages. Is there a way to disable them with an environment variable or something like that? Or do I need to change the code by either commenting them out, or defining my own Bool vars and adding if checks:
if isDebugLogging {
os_log(.debug, log:log, ...)
}
The docs mention being able to do this for macOS, but I'm specifically asking about iOS.
I don't want to shut it all off. For this to be useful I need a way to shut it off by subsystem or category.