---
title: "record(_:sourceLocation:)"
framework: testing
role: symbol
role_heading: Type Method
path: "testing/issue/record(_:sourcelocation:)"
---

# record(_:sourceLocation:)

Records an issue that a test encounters while it’s running.

## Declaration

```swift
@discardableResult static func record(_ comment: Comment? = nil, sourceLocation: SourceLocation = #_sourceLocation) -> Issue
```

## Parameters

- `comment`: A comment describing the expectation.
- `sourceLocation`: The source location to which the issue should be attributed.

## Return Value

Return Value The issue that was recorded.

## Discussion

Discussion Use this function if, while running a test, an issue occurs that cannot be represented as an expectation (using the expect(_:_:sourceLocation:) or require(_:_:sourceLocation:) macros.)
