<!--
{
  "availability" : [
    "SwiftPM: 6.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PackageDescription",
  "identifier" : "/documentation/PackageDescription/WarningLevel",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "PackageDescription"
    ],
    "preciseIdentifier" : "s:18PackageDescription12WarningLevelO"
  },
  "title" : "WarningLevel"
}
-->

# WarningLevel

The level at which a compiler warning should be treated.

```
enum WarningLevel
```

## Overview

This enum is used with the `SwiftSetting.treatAllWarnings(as:_:)` and
`SwiftSetting.treatWarning(name:as:_:)` methods to control how warnings
are handled during compilation.

## Topics

### Enumeration Cases

[`case error`](/documentation/PackageDescription/WarningLevel/error)

Treat as an error.

[`case warning`](/documentation/PackageDescription/WarningLevel/warning)

Treat as a warning.

## Relationships

### Conforms To

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

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

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

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

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

---

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)