Created
June 7, 2024 10:17
-
-
Save yannxou/c973f998a9a5f8cd13b3bed516ab4cc7 to your computer and use it in GitHub Desktop.
Xcode Logger formatting with optional parameters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://developer.apple.com/wwdc20/10168 | |
let statisticsLogger = Logger (subsystem: "com.example.Fruta", category: "statistics") | |
// Log statistics about communication with a server. | |
func logStatistics(taskID: UUID, giftCardID: String, serverID: Int, seconds: Double) { | |
statisticsLogger.log("\(taskID) \(giftCardID, align: .left(columns: GiftCard.maxIDLength)) \(serverID) \(seconds, format: .fixed(precision: 2))") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment