---
title: "fault(_:)"
framework: os
role: symbol
role_heading: Instance Method
path: "os/logger/fault(_:)"
---

# fault(_:)

Writes a message to the log about a bug that occurs when your app executes.

## Declaration

```swift
func fault(_ message: OSLogMessage)
```

## Parameters

- `message`: The interpolated string that the logger writes to the log. Each of the message’s interpolations can specify individual formatting and privacy options. For more information, see doc://com.apple.os/documentation/os/message-argument-formatters.

## Discussion

Discussion important: Don’t create an instance of OSLogMessage. Instead, provide an interpolated string as the message parameter and the system converts it automatically. Use this method to write messages with the fault log level to both the in-memory and on-disk log stores.

## See Also

### Logging a Scoped Message

- [notice(_:)](os/logger/notice(_:).md)
- [debug(_:)](os/logger/debug(_:).md)
- [trace(_:)](os/logger/trace(_:).md)
- [info(_:)](os/logger/info(_:).md)
- [error(_:)](os/logger/error(_:).md)
- [warning(_:)](os/logger/warning(_:).md)
- [critical(_:)](os/logger/critical(_:).md)
