os_log(_:log:_:)
Adds a new log message using an optional log object and log level.
Declaration
func os_log(_ logLevel: OSLogType = .default, log logObject: OSLog = .default, _ message: OSLogMessage)Parameters
- logLevel:
The log level to assign to the message. For more information about log levels, see Oslogtype.
- logObject:
The log object that receives the message. The message inherits the same subsystem and category as the log object.
- message:
A string containing the message you want to log. Always specify this parameter as a string; this function converts it to an Oslogmessage object. The string may contain interpolated values.
Discussion
Use this method to capture information at any log level.