For the following function:
let authenticationLogger = OSLog(subsystem: "com.Company.AppNameQA" ?? "Empty bundleIdentifier", category: "Authenticaiton)
What should I do if I want to disable/enable a certain log level?
Currently with the API the only thing that I'm able to access is the isEnabled
fucntion:
authenticationLogger.isEnabled(.error)
which just returns whether it's enabled or not.
I haven't tried this yet. But I believe this is the solution
Reading from docs.
Under the section of:
Customizing Logging Behavior While Debugging
Enabling debug-level logging for a subsystem
Use the log tool’s status argument to check the current logging level of a subsystem.
Checking the log level of 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. Name the file using an identifier string, in reverse DNS notation, representing the subsystem. For example,
com.your_company.your_subsystem_name.plist
. Next, add one or more settings dictionaries to the top level of the file. A DEFAULT-OPTIONS settings dictionary defines global behavior settings for the entire subsystem. Category settings dictionaries define behavior for specific categories of messages within the subsystem.Top level structure of a logging profile
In a nutshell, you can't change the log level from you code in production. You can only change it during debugging. What use can it have? I'm not sure!