os_log(_:dso:log:_:_:)
Sends a message to the logging system, optionally specifying a custom log object, log level, and any message-format arguments.
Declaration
func os_log(_ type: OSLogType, dso: UnsafeRawPointer = #dsohandle, log: OSLog = .default, _ message: StaticString, _ args: any CVarArg...)Parameters
- type:
The log level to assign to the message. For more information about log levels, see Oslogtype.
- log:
A custom log object. If unspecified, system uses the shared default log.
- message:
A constant string or format string that produces a human-readable log message.
- args:
If
messageis a constant string, do not specify arguments.If
messageis a format string, pass the expected number of arguments in the order that they appear in the string.
Discussion
Call this function to capture information about things that might result in a failure. For more information about format strings, see Formatting Log Messages.