Contents

OSLogInt32ExtendedFormat.darwinSignal

A format that displays a 32-bit integer as a Darwin signal.

Declaration

case darwinSignal

Discussion

Use this option to format the interpolated value as a Darwin signal, such as sigsegv: Segmentation fault. The following example applies the darwinSignal formatter to the 32-bit integer value 25:

// Create a logger with the specified subsystem and category.
let logger = Logger(subsystem: "com.example.OSLogValueFormatting",
                    category: "Formatter Output")
                
// Assign the value to interpolate.
let value: Int32 = 25
                
// Write the value to the log using the specified format.
logger.info(".darwinSignal output is \(value, format: .darwinSignal)")

And the system writes the following message to the log:

[Formatter Output] .darwinSignal output is [sigxfsz: Filesize limit exceeded]

See Also

Getting the Formats