<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLLogStateDescriptor",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(cs)MTLLogStateDescriptor"
  },
  "title" : "MTLLogStateDescriptor"
}
-->

# MTLLogStateDescriptor

An interface that represents a log state configuration.

```
class MTLLogStateDescriptor
```

## Overview

Configure the descriptor to create an [`MTLLogState`](/documentation/Metal/MTLLogState) by calling [`makeLogState(descriptor:)`](/documentation/Metal/MTLDevice/makeLogState(descriptor:)).

If you’ve set the environment variables `MTL_LOG_BUFFER_SIZE` or `MTL_LOG_LEVEL`, then the system automatically enables logging. If any command buffer or command queue has an attached log state, then the system uses the log state’s settings instead of the environment variable values.

## Topics

### Instance properties

[`bufferSize`](/documentation/Metal/MTLLogStateDescriptor/bufferSize)

The size of the internal buffer the log state uses, specified in bytes.

[`level`](/documentation/Metal/MTLLogStateDescriptor/level)

The minimum level of messages that the shader can log.

### Log levels

[`MTLLogLevel`](/documentation/Metal/MTLLogLevel)

The supported log levels for shader logging.



---

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)