---
title: logState
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtl4commandbufferoptions/logstate
---

# logState

Contains information related to shader logging.

## Declaration

```swift
var logState: (any MTLLogState)? { get set }
```

## Discussion

Discussion To enable shader logging, call beginCommandBuffer(allocator:options:) with an instance of MTL4CommandBufferOptions that contains a non-nil MTLLogState instance in this property. Shader functions log messages until the command buffer ends.
