---
title: "dump(_:name:indent:maxDepth:maxItems:)"
framework: swift
role: symbol
role_heading: Function
path: "swift/dump(_:name:indent:maxdepth:maxitems:)"
---

# dump(_:name:indent:maxDepth:maxItems:)

Dumps the given object’s contents using its mirror to standard output.

## Declaration

```swift
@discardableResult func dump<T>(_ value: T, name: String? = nil, indent: Int = 0, maxDepth: Int = .max, maxItems: Int = .max) -> T
```

## Parameters

- `value`: The value to output to the target stream.
- `name`: A label to use when writing the contents of value. When nil is passed, the label is omitted. The default is nil.
- `indent`: The number of spaces to use as an indent for each line of the output. The default is 0.
- `maxDepth`: The maximum depth to descend when writing the contents of a value that has nested components. The default is Int.max.
- `maxItems`: The maximum number of elements for which to write the full contents. The default is Int.max.

## Return Value

Return Value The instance passed as value.

## See Also

### Printing and Dumping

- [print(_:separator:terminator:)](swift/print(_:separator:terminator:).md)
- [print(_:separator:terminator:to:)](swift/print(_:separator:terminator:to:).md)
- [debugPrint(_:separator:terminator:)](swift/debugprint(_:separator:terminator:).md)
- [debugPrint(_:separator:terminator:to:)](swift/debugprint(_:separator:terminator:to:).md)
- [dump(_:to:name:indent:maxDepth:maxItems:)](swift/dump(_:to:name:indent:maxdepth:maxitems:).md)
