-
Notifications
You must be signed in to change notification settings - Fork 335
Simplify logging Error types #267
Copy link
Copy link
Closed
Description
While developing a server-side web app, it is very common to log errors. But, the library doesn't automatically extract the localizedDescription from Error types.
Given
let error = // some `Error` type thrown
let logger = Logger(label: "com.example")Expected behavior
logger.error(error)Actual behavior
logger.error(error.localizedDescription) // This doesn't even compile
logger.error("\(error.localizedDescription)") // It works but it is very cumbersomeSolution
Add an extra error() method to handle Error types automatically.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels