mirror of
https://github.com/apple/swift-log
synced 2026-11-24 03:47:49 +00:00
Conform `Logger.Level` to `CustomStringConvertible` and `LosslessStringConvertible`. ### Motivation: There are libraries, such as Vapor, that add these conformances privately and `@retroactive`ly. This would avoid having to implement these conformances manually in each library and would unify and standardise the implementation. ### Modifications: Make `Logger.Level` conform to `CustomStringConvertible` and `LosslessStringConvertible`, adding a public `description` computed property that returns the `rawValue` and a public initializer that takes a `description` string, lowercases it, and passes it to the `rawValue` initializer. ### Result: `Logger.Level` conforms to `CustomStringConvertible` and `LosslessStringConvertible`.