OSLogInt32ExtendedFormat.byteCountIEC
A format that displays a 32-bit integer as IEC bytes.
Declaration
case byteCountIECDiscussion
Use this option to format the interpolated value as IEC bytes, such as 100 KiB. The following example applies the byteCountIEC formatter to the 32-bit integer value 102_400:
// 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 = 102_400
// Write the value to the log using the specified format.
logger.info(".byteCountIEC output is \(value, format: .byteCountIEC)")And the system writes the following message to the log:
[Formatter Output] .byteCountIEC output is 100 KiBSee Also
Getting the Formats
OSLogInt32ExtendedFormat.ipv4AddressOSLogInt32ExtendedFormat.secondsSince1970OSLogInt32ExtendedFormat.darwinErrnoOSLogInt32ExtendedFormat.darwinModeOSLogInt32ExtendedFormat.darwinSignalOSLogInt32ExtendedFormat.bitrateOSLogInt32ExtendedFormat.bitrateIECOSLogInt32ExtendedFormat.byteCountOSLogInt32ExtendedFormat.truthOSLogInt32ExtendedFormat.answer