<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "os",
  "identifier" : "/documentation/os/OSLogInt32ExtendedFormat/ipv4Address",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "os"
    ],
    "preciseIdentifier" : "s:2os24OSLogInt32ExtendedFormatO11ipv4AddressyA2CmF"
  },
  "title" : "OSLogInt32ExtendedFormat.ipv4Address"
}
-->

# OSLogInt32ExtendedFormat.ipv4Address

A format that displays a 32-bit integer as an IPv4 address.

```
case ipv4Address
```

## Discussion

Use this option to format the interpolated value as an IPv4 address, such as `127.0.0.1`. The following example applies the `ipv4Address` formatter to the 32-bit integer value `0x0100007f`:

```swift
// 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 = 0x0100007f
                
// Write the value to the log using the specified format.
logger.info(".ipv4Address output is \(value, format: .ipv4Address)")
```

And the system writes the following message to the log:

```
[Formatter Output] .ipv4Address output is 127.0.0.1
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)