---
title: os_log_with_type
framework: os
role: symbol
role_heading: Macro
path: os/os_log_with_type
---

# os_log_with_type

Sends a message at a specific logging level, such as default, info, debug, error, or fault, to the logging system.

## Declaration

```occ
#define os_log_with_type(log, type, format, ...)
```

## Parameters

- `log`: The doc://com.apple.os/documentation/os/OS_LOG_DEFAULT constant or a custom log object previously created by the doc://com.apple.os/documentation/os/os_log_create function.
- `type`: A log type constant, such as doc://com.apple.os/documentation/os/os_log_type_t/OS_LOG_TYPE_DEFAULT, doc://com.apple.os/documentation/os/os_log_type_t/OS_LOG_TYPE_INFO, doc://com.apple.os/documentation/os/os_log_type_t/OS_LOG_TYPE_DEBUG, doc://com.apple.os/documentation/os/os_log_type_t/OS_LOG_TYPE_ERROR, or doc://com.apple.os/documentation/os/os_log_type_t/OS_LOG_TYPE_FAULT, that specifies the level of logging to perform.
- `format`: A constant string or format string that produces a human-readable log message. See https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFStrings/formatSpecifiers.html#//apple_ref/doc/uid/TP40004265.

## Discussion

Discussion Calling this function doesn’t ensure that the system logs a message. Logging always occurs in accordance with the behavior settings of the provided log object and log type. Note that the logging system may truncate lengthy log messages when it stores them.

## See Also

### Related Documentation

- [os_log_type_t](kernel/os_log_type_t.md)

### Log Messages

- [Message Argument Formatters](os/message-argument-formatters.md)
- [Legacy Logging Symbols](os/legacy-logging-symbols.md)
- [os_log_t](os/os-log-t.md)
- [OSLogType](os/oslogtype.md)
- [os_log](os/os_log.md)
- [os_log_info](os/os_log_info.md)
- [os_log_debug](os/os_log_debug.md)
- [os_log_error](os/os_log_error.md)
- [os_log_fault](os/os_log_fault.md)
