In Native code…
import OSLog
let logger = Logger(subsystem: "com.yourcompany.yourapp", category: "yourCategory")
Subsystem: A reverse DNS string that identifies your app or a specific part of it.
**category**: A string that categorizes the log messages within your subsystem (e.g., “Networking”, “UI”, “DataPersistence”).
Example use:
logger.trace("This is a trace message.")
logger.debug("This is a debug message.")
logger.info("This is an info message.")
logger.notice("This is a notice message.")
logger.warning("This is a warning message.")
logger.error("This is an error message: \(error.localizedDescription)")
logger.critical("This is a critical error, potentially leading to a crash.")