<!--
{
  "availability" : [
    "*: -"
  ],
  "documentType" : "symbol",
  "framework" : "XCTest",
  "identifier" : "/documentation/XCTest/XCTestLog",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "XCTest"
    ],
    "preciseIdentifier" : "c:objc(cs)XCTestLog"
  },
  "title" : "XCTestLog"
}
-->

# XCTestLog

An object that logs test failures and errors.

```
class XCTestLog
```

## Topics

### Logging Test Results

[`logFileHandle`](/documentation/XCTest/XCTestLog/logFileHandle)

An object to interact with the test log file.

[`-  testLogWithFormat:arguments:`](/documentation/XCTest/XCTestLog/testLog(withFormat:arguments:))

Logs test results to the test log.

[`-  testLogWithFormat:`](/documentation/XCTest/XCTestLog/testLogWithFormat:)

Logs test results to the test log.

## Relationships

### Inherits From

[`XCTestObserver`](/documentation/XCTest/XCTestObserver)

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

---

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)