March 16, 2021
Since iOS 14, Apple released a new logging framework that replace the not so old os_log
framework introduced with iOS 10.
Logger+extensions.swift
import os.log
extension Logger {
static var ui = Logger(subsystem: "be.brunowernimont.aucast", category: "ui")
}
import os.log
Logger.ui.logger.debug("\(region.identifier, privacy: .public) enter \(enter)")
Strings are considered as private by default and won’t be visible if your device isn’t plugged, to protect the user privacy.
There are many different logging types that you can use: