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

# log(_:)

Writes a message to the log using the default log type.

## Declaration

```swift
func log(_ 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 using the default log level to both the in-memory and on-disk log stores. This method is functionally equivalent to the notice(_:) method.

## See Also

### Logging a Message

- [log(level:_:)](os/logger/log(level:_:).md)
- [OSLogType](os/oslogtype.md)
- [OSLogMessage](os/oslogmessage.md)
