{"id":338925,"date":"2022-09-27T15:00:31","date_gmt":"2022-09-27T15:00:31","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=338925"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=338925","title":{"rendered":"<span>\u041b\u043e\u0433\u0438 \u0432 iOS, \u044d\u043f\u0438\u0437\u043e\u0434 1: os_log<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/055\/e4b\/fe0\/055e4bfe08375f6be6d0d55a7e037e71.png\" width=\"1120\" height=\"630\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/055\/e4b\/fe0\/055e4bfe08375f6be6d0d55a7e037e71.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0441\u0430\u0434\u0438\u0442\u0435\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f iOS\/iPadOS\/macOS\/tvOS\/watchOS.  \u041e\u0447\u0435\u043d\u044c \u0441\u043a\u043e\u0440\u043e \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u0441 \u043f\u0435\u0440\u0432\u044b\u043c \u0431\u0430\u0433\u043e\u043c \u0438, \u0447\u0442\u043e\u0431\u044b \u0435\u0433\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u043b\u043e\u0433\u0438 \u2014 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0435\u00a0<code>print()<\/code>\u00a0\u0442\u0443\u0442 \u0438 \u0442\u0430\u043c. \u0411\u0430\u0433 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u0438 \u0447\u0430\u0441\u0442\u044c \u043b\u043e\u0433\u043e\u0432 \u0443\u0431\u0440\u0430\u043b\u0438, \u0430 \u0447\u0430\u0441\u0442\u044c \u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u043d\u0430 \u0431\u0443\u0434\u0443\u0449\u0435\u0435 \u2014 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435, \u0435\u0449\u0451 \u043f\u0440\u0438\u0433\u043e\u0434\u044f\u0442\u0441\u044f.<\/p>\n<p>\u0421\u043f\u0443\u0441\u0442\u044f \u043f\u0430\u0440\u0443 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0432 Xcode \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u043e\u0434\u043e\u043f\u0430\u0434 \u0438\u0437 \u043b\u043e\u0433\u043e\u0432. \u0412 \u043d\u0438\u0445 \u0441\u043b\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0432 \u043d\u0438\u0445 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0435 \u044d\u0442\u043e \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u0438 \u0432 \u043d\u043e\u0432\u044b\u0435 \u043b\u043e\u0433\u0438 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043c\u0430\u0440\u043a\u0435\u0442\u044b \u043f\u043e \u0442\u0438\u043f\u0443\u00a0<code>\"----->\"<\/code>\u00a0\u0438\u043b\u0438 \u0435\u0449\u0451 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0432 \u044d\u0442\u043e\u043c \u0434\u0443\u0445\u0435 \u2014 \u0442\u0430\u043a \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0442\u044c \u0432 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435.<\/p>\n<p>\u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u0440\u043e\u0432\u043d\u043e \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442. \u0412 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0435 \u0432\u044b\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0435 \u0438 \u0447\u0438\u0441\u0442\u0438\u0442\u0435 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445, \u043f\u043e \u0432\u0430\u0448\u0435\u043c\u0443 \u043c\u043d\u0435\u043d\u0438\u044e, \u043b\u043e\u0433\u043e\u0432, \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0437\u0430\u0446\u0435\u043f\u043b\u044f\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0438\u043c\u0438 \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u0432\u0430\u0441 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043b\u043e\u0433\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442. \u041a\u0430\u043a\u043e\u0432\u0430 \u0438\u0445 \u0446\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u2014 \u043d\u0435 \u044f\u0441\u043d\u043e.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a Apple \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0440\u0435\u0448\u0430\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443.<\/p>\n<h2>Console.app<\/h2>\n<p>Apple \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u043b\u043e\u0433\u0438 \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u2014 Console.app, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u0432 macOS. \u041d\u043e \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0441 \u0432\u0430\u0448\u0438\u043c \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u0442\u043e \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0435\u0449\u0451 \u0431\u043e\u0301\u043b\u044c\u0448\u0443\u044e \u043f\u043e\u0440\u0442\u044f\u043d\u043a\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439: \u0442\u0443\u0442 \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043b\u043e\u0433\u0438, \u0438 \u043b\u043e\u0433\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d46\/684\/3f1\/d466843f1bf0584407413ea09893399c.png\" width=\"2000\" height=\"1246\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d46\/684\/3f1\/d466843f1bf0584407413ea09893399c.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0439\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u0440\u0430\u0432\u0430 \u0441\u0432\u0435\u0440\u0445\u0443 \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u0435 \u043f\u043e\u0438\u0441\u043a\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 LogsDemo, \u0442\u0430\u043a \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0435\u0433\u043e \u0438 \u0432\u0432\u043e\u0436\u0443 \u0432 \u043f\u043e\u043b\u0435 \u043f\u043e\u0438\u0441\u043a\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/854\/1ee\/ab7\/8541eeab750213313a0ccff22760f46b.png\" width=\"2000\" height=\"1246\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/854\/1ee\/ab7\/8541eeab750213313a0ccff22760f46b.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0443\u0441\u0442\u043e. \u042d\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e <code>print()<\/code> \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043b\u043e\u0433 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c Xcode, \u0430 Console.app \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0447\u0438\u0442\u0430\u0442\u044c \u043b\u043e\u0433\u0438 \u0438\u0437 \u043b\u043e\u0433-\u0444\u0430\u0439\u043b\u043e\u0432. \u0427\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0438\u0441\u044c \u0448\u043b\u0430 \u0432 \u044d\u0442\u0438 \u0441\u0430\u043c\u044b\u0435 \u043b\u043e\u0433-\u0444\u0430\u0439\u043b\u044b, \u043d\u0443\u0436\u043d\u043e <code>print()<\/code> \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 <code>os_log()<\/code>. Apple \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u044c\u044e <a href=\"https:\/\/developer.apple.com\/documentation\/os\/logging\">Unified Logging System<\/a>.<\/p>\n<p>\u0417\u0430\u043c\u0435\u043d\u044f\u0435\u043c, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a:<\/p>\n<pre><code class=\"swift\">let message = \"\u041d\u0430\u0448\u0435 \u0441 \u0432\u0430\u043c\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u043f\u0430\u0434\u0451\u0442 \u0432 \u043b\u043e\u0433\u0438\"  \/\/ \u0432\u044b\u0437\u043e\u0432 os_log \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 OSLog let osLog = OSLog(subsystem: \"LogsDemo\", category: \"\")   os_log(.debug, \/\/ \u0433\u043e\u0432\u043e\u0440\u0438\u043c, \u0447\u0442\u043e \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043b\u043e\u0433\u0430 \u0431\u0443\u0434\u0435\u0442 'debug' log: osLog, \/\/ \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 OSLog \"%{public}@\", message as! CVarArg) \/\/ \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u043d\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c: \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c Xcode \u043b\u043e\u0433\u0438 \u043f\u0430\u0434\u0430\u044e\u0442, \u0430 \u0432 Console.app \u0432\u0441\u0451 \u0435\u0449\u0451 \u043d\u0435\u0442.<\/p>\n<h3>\u0423\u0440\u043e\u0432\u043d\u0438 \u043b\u043e\u0433\u043e\u0432<\/h3>\n<p>\u041b\u043e\u0433\u0438 \u0443\u0440\u043e\u0432\u043d\u044f <code>.debug<\/code> \u043d\u0435 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043b\u043e\u0433-\u0444\u0430\u0439\u043b, \u0430 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0443\u043b\u0435\u0442\u0430\u0435\u0442 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c Xcode. \u0427\u0442\u043e\u0431\u044b \u043b\u043e\u0433 \u0434\u043e\u043b\u0435\u0442\u0435\u043b \u0434\u043e \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439.<\/p>\n<p>\u0412\u0441\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u0435\u0439 \u043f\u044f\u0442\u044c:<\/p>\n<pre><code class=\"swift\">public static let `default`: OSLogType public static let info: OSLogType public static let debug: OSLogType public static let error: OSLogType public static let fault: OSLogType<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043a\u0430 \u0443\u043a\u0430\u0436\u0435\u043c <code>.default<\/code> \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a41\/de2\/372\/a41de2372b7e0dfc2354fa973e0e9c9f.png\" width=\"2000\" height=\"1185\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a41\/de2\/372\/a41de2372b7e0dfc2354fa973e0e9c9f.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0441\u0451 \u0435\u0449\u0451 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043b\u043e\u0433\u0438 \u2014 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u0432 \u043f\u043e\u043b\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u0441\u043a\u0430\u0437\u0430\u043b\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u043b\u043e\u0433\u0438 \u043e\u0442 LogsDemo. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u044d\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0438 \u043b\u043e\u0433\u0438 \u043e\u0442 iOS, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043b\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u0432 \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0443\u0445\u0438.<\/p>\n<h4>\u0424\u0438\u043b\u044c\u0442\u0440\u044b<\/h4>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u0442\u043e\u0447\u043d\u0438\u043c \u0444\u0438\u043b\u044c\u0442\u0440. \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/25a\/c72\/2d4\/25ac722d4ee389d1ecfc1f86cd5d4e7a.png\" alt=\"\u0412\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0438 \u043d\u0438\u0436\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f.  \" title=\"\u0412\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0438 \u043d\u0438\u0436\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f.  \" width=\"382\" height=\"926\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/25a\/c72\/2d4\/25ac722d4ee389d1ecfc1f86cd5d4e7a.png\"\/><figcaption>\u0412\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0438 \u043d\u0438\u0436\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f.  <\/figcaption><\/figure>\n<p>\u041d\u0430\u043c \u043f\u043e\u0434\u043e\u0439\u0434\u0443\u0442 <code>Library<\/code>, <code>Equals<\/code>:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7ed\/3b2\/278\/7ed3b2278332dfd21d9d888be4284530.png\" alt=\"\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u043b\u043e\u0433\u0438 \u0438\u0437 \u0434\u0435\u043c\u043e-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.\" title=\"\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u043b\u043e\u0433\u0438 \u0438\u0437 \u0434\u0435\u043c\u043e-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.\" width=\"2000\" height=\"1159\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7ed\/3b2\/278\/7ed3b2278332dfd21d9d888be4284530.png\"\/><figcaption>\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u043b\u043e\u0433\u0438 \u0438\u0437 \u0434\u0435\u043c\u043e-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/figcaption><\/figure>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u0434\u043e. \u041d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0432 \u043f\u043e\u0438\u0441\u043a\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0443\u0442\u043e\u0447\u043d\u044f\u0442\u044c \u0444\u0438\u043b\u044c\u0442\u0440 \u2014 \u043b\u0435\u043d\u044c. \u0425\u043e\u0440\u043e\u0448\u043e, \u0447\u0442\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c: \u043f\u0440\u044f\u043c\u043e \u043f\u043e\u0434 \u043f\u043e\u043b\u0435\u043c \u043f\u043e\u0438\u0441\u043a\u0430 \u0435\u0441\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0430 Save. \u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c, \u0432\u0432\u043e\u0434\u0438\u043c \u0438\u043c\u044f \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0438 \u043e\u043d \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0442\u0443\u043b\u0431\u0430\u0440\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/94e\/384\/2dc\/94e3842dc00c702b959d7404d535c974.png\" alt=\"\u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0436\u0438\u0432\u0443\u0449\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0434\u043b\u044f \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0414\u043e\u0434\u043e \u041f\u0438\u0446\u0446\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0441\u0432\u043e\u0438\u0445 \u043f\u0435\u0442-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.\" title=\"\u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0436\u0438\u0432\u0443\u0449\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0434\u043b\u044f \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0414\u043e\u0434\u043e \u041f\u0438\u0446\u0446\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0441\u0432\u043e\u0438\u0445 \u043f\u0435\u0442-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.\" width=\"874\" height=\"260\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/94e\/384\/2dc\/94e3842dc00c702b959d7404d535c974.png\"\/><figcaption>\u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0436\u0438\u0432\u0443\u0449\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0434\u043b\u044f \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0414\u043e\u0434\u043e \u041f\u0438\u0446\u0446\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0441\u0432\u043e\u0438\u0445 \u043f\u0435\u0442-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.<\/figcaption><\/figure>\n<p>\u041c\u043e\u0436\u043d\u043e \u0434\u0430\u0436\u0435 \u0444\u0438\u043b\u044c\u0442\u0440 \u0432\u043e\u0442\u043a\u043d\u0443\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0438. \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0435 \u043c\u0435\u043d\u044e \u043b\u043e\u0433\u0430 \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0438 \u043f\u0440\u043e\u0441\u0438\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0448\u0438\u0431\u043a\u0438:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bdc\/965\/5ed\/bdc9655edc186a276559a2d86b2b75be.png\" alt=\"\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0435 \u043c\u0435\u043d\u044e \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0441\u0432\u043e\u0451. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0443\u043d\u043a\u0442\u044b \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0435\u0439 \u043f\u043e \u043f\u043e\u043b\u044e Type, \u043d\u0443\u0436\u043d\u043e \u043a\u043b\u0438\u043a\u043d\u0443\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e \u043a\u043e\u043b\u043e\u043d\u043a\u0435 Type.\" title=\"\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0435 \u043c\u0435\u043d\u044e \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0441\u0432\u043e\u0451. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0443\u043d\u043a\u0442\u044b \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0435\u0439 \u043f\u043e \u043f\u043e\u043b\u044e Type, \u043d\u0443\u0436\u043d\u043e \u043a\u043b\u0438\u043a\u043d\u0443\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e \u043a\u043e\u043b\u043e\u043d\u043a\u0435 Type.\" width=\"508\" height=\"904\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bdc\/965\/5ed\/bdc9655edc186a276559a2d86b2b75be.png\"\/><figcaption>\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0435 \u043c\u0435\u043d\u044e \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0441\u0432\u043e\u0451. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0443\u043d\u043a\u0442\u044b \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0435\u0439 \u043f\u043e \u043f\u043e\u043b\u044e Type, \u043d\u0443\u0436\u043d\u043e \u043a\u043b\u0438\u043a\u043d\u0443\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e \u043a\u043e\u043b\u043e\u043d\u043a\u0435 Type.<\/figcaption><\/figure>\n<p>\u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u0433\u0438 \u0441 \u0443\u0440\u043e\u0432\u043d\u0435\u043c <code>.error:<\/code><\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/039\/32f\/6a7\/03932f6a7a4a6d95646efa0d77cb9a44.png\" width=\"2000\" height=\"1185\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/039\/32f\/6a7\/03932f6a7a4a6d95646efa0d77cb9a44.png\"\/><figcaption><\/figcaption><\/figure>\n<h3>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043b\u043e\u0433\u0430<\/h3>\n<p>\u0413\u043e\u0440\u0430\u0437\u0434\u043e \u0447\u0430\u0449\u0435 \u043f\u0440\u0438 \u0434\u0435\u0431\u0430\u0433\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0435 \u00ab\u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0448\u0438\u0431\u043a\u0438\u00bb, \u0430 \u043b\u043e\u0433\u0438 \u00ab\u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f N\u00bb. \u041c\u044b \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u0438\u043b\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0414\u043e\u0434\u043e \u041f\u0438\u0446\u0446\u044b \u043d\u0430 \u043c\u043e\u0434\u0443\u043b\u0438 \u2014 \u0438\u0445 \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 62. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u0433\u0438 \u0438\u0437 \u0441\u0435\u0442\u0438 \u2014 \u0432\u043f\u043e\u043b\u043d\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u043b\u044f \u043d\u0430\u0441 \u043a\u0435\u0439\u0441. \u0412 \u0434\u0435\u043c\u043e-\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c Network, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u043c \u043b\u043e\u0433\u0438 \u0434\u043e \u043d\u0435\u0433\u043e. \u041d\u043e \u043e\u0442\u043a\u0443\u0434\u0430 \u0432\u0437\u044f\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f? \u0418 \u043a\u0443\u0434\u0430 \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c? \u041f\u0438\u0441\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0437\u0432\u0443\u0447\u0438\u0442 \u043a\u0430\u043a \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430. \u0414\u0430 \u0438 \u0435\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u0441 \u043a\u043e\u0434\u043e\u043c \u043c\u0435\u0436\u0434\u0443 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0431\u044b\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>\u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u044f \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u0435\u0437 \u043d\u0430\u043f\u0440\u044f\u0433\u0430? \u0415\u0433\u043e \u0432\u0435\u0440\u043d\u0451\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>#fileID<\/code>:<\/p>\n<pre><code class=\"swift\">let fileID: StaticString = #fileID \/\/ \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 LogsDemo\/ViewController.swift  let module = URL(fileURLWithPath: self).deletingPathExtension().pathComponents[1] \/\/ \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 LogsDemo<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432 <a href=\"http:\/\/console.app\/\">Console.app<\/a> \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0438\u043b\u044c\u0442\u0440 \u043f\u043e <code>Subsystem: Network<\/code> \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u0433\u0438 \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f <code>Network<\/code>:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/5da\/d67\/5f3\/5dad675f39a958de332b200fb61f8b47.png\" width=\"2000\" height=\"1294\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5da\/d67\/5f3\/5dad675f39a958de332b200fb61f8b47.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c \u0437\u043d\u0430\u0435\u043c. \u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435?<\/p>\n<ol>\n<li>\n<p>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f, \u043f\u0440\u044f\u043c\u043e \u0438\u0437 <code>#fileID<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0438\u0437 <code>#function<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0440\u043e\u0447\u043a\u0443 \u0438\u0437 <code>#line<\/code>.<\/p>\n<\/li>\n<\/ol>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u043a\u043b\u0435\u0438\u0432\u0430\u0435\u043c \u044d\u0442\u043e \u0432\u0441\u0451 \u0432 \u043e\u0434\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"swift\">\/\/ \u0420\u0430\u043d\u044c\u0448\u0435 \u0432 OSLog \u0432 \u043f\u043e\u043b\u0435 subsystem \u043c\u044b \u043f\u043e\u0434\u0430\u0432\u0430\u043b\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \/\/ \u041d\u043e \u043e\u043d\u043e \u0438 \u0442\u0430\u043a \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0432 \u043b\u043e\u0433\u0438 \u0432 \u043f\u043e\u043b\u0435 Library \/\/ \u0422\u0430\u043a \u0447\u0442\u043e \u043c\u044b \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0430\u0451\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f let osLog = OSLog(subsystem: module, category: \"\")  let fileFunction = [filename, function].joined(separator: \".\") let source = [fileFunction, line].joined(separator: \":\")  let formattedMessage = [source, message].joined(separator: \"\\n\\n\")  os_log(.default,        log: osLog,        \"%{public}@\", formattedMessage) <\/code><\/pre>\n<p>\u0412 Console.app \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e13\/095\/06a\/e1309506a5b54af6b0edfe28f69360dc.png\" width=\"2000\" height=\"1185\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e13\/095\/06a\/e1309506a5b54af6b0edfe28f69360dc.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0432 \u043a\u0430\u043a\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435, \u0432 \u043a\u0430\u043a\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0438 \u043d\u0430 \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e. \u041d\u0443, \u0435\u0441\u043b\u0438 \u0437\u0430\u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043b\u0438.<\/p>\n<h3>\u0410 \u0447\u0442\u043e \u0435\u0449\u0451 \u043c\u043e\u0436\u043d\u043e?<\/h3>\n<p>\u0414\u0430 \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u2014 <code>os_log<\/code> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043b\u044e\u0431\u043e\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0435\u0433\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c.<\/p>\n<p>\u041e\u0448\u0438\u0431\u043a\u0443? \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430:<\/p>\n<pre><code class=\"swift\">enum TaxCalculationError: Error {     case invalidTaxConfig }  let message = String(reflecting: TaxCalculationError.invalidTaxConfig) os_log(.error,        log: logger,        \"%{public}@\", message) <\/code><\/pre>\n<p>\u0417\u0430\u043c\u0435\u0440? \u0422\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e:<\/p>\n<pre><code class=\"swift\">\/\/ \u043b\u043e\u0433\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0430\u0440\u0442 let startMessage = \"Will get profile\"  \/\/ \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u043d\u0435\u0442, \u0442\u0430\u043a \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 os_log(.default,         log: logger,        \"%{public}@\", startMessage)    \/\/ \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0432\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u043d\u0430\u0447\u0430\u043b\u0438 let startDate = Date()  \/\/ \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0434\u043e\u043b\u0433\u0438\u0439 \u043a\u043e\u0434 let response = networkService.data(for: ProfileRequest()) let profileModel = ProfileModel(response)  \/\/ \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0432\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438 let endDate = Date()  \/\/ \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0435 \u0438 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f  let duration = endDate.timeInterval(since: startDate) let durationFormatter = String(format: \"%.2f\", duration)  \/\/ \u043b\u043e\u0433\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043d\u0435\u0446 \u0441 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e let endMessage = \"Got profile, took \\(durationFormatter)s\" os_log(.default,        log: logger,        \"%{public}@\", endMessage) <\/code><\/pre>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0421\u0432\u044f\u0437\u043a\u0430 <code>os_log<\/code> \u0438 Console.app \u2014 \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0441\u043b\u043e\u0439 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0432 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0448\u0438\u0431\u043a\u0438, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0437\u0430\u043c\u0435\u0440\u0438\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0443 \u0432\u0430\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u0442\u0430 \u0438\u043b\u0438 \u0438\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u044d\u0442\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0432 \u043b\u043e\u0433\u0438.<\/p>\n<p>\u041d\u043e \u0434\u043b\u044f \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0411\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442\u0430, \u0443\u0436 \u043f\u0440\u043e\u0441\u0442\u0438\u0442\u0435 \u043c\u043d\u0435 \u044d\u0442\u043e \u0441\u043b\u043e\u0432\u043e. \u041d\u0430\u0434\u043e \u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u0438 \u0437\u0430\u043c\u0435\u0440\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a\u0430\u043a-\u0442\u043e \u0435\u0449\u0451 \u043f\u0440\u0438\u043f\u0438\u0445\u043d\u0443\u0442\u044c. \u041a\u0430\u043a \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u2014 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439. \u041f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c, \u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043b\u0430\u0439\u043a\u0438, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0439\u0442\u0435 \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u0434\u0440\u0443\u0437\u044c\u044f\u043c.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/dododev\/blog\/689758\/\"> https:\/\/habr.com\/ru\/company\/dododev\/blog\/689758\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0441\u0430\u0434\u0438\u0442\u0435\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0434\u043b\u044f iOS\/iPadOS\/macOS\/tvOS\/watchOS.  \u041e\u0447\u0435\u043d\u044c \u0441\u043a\u043e\u0440\u043e \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u0441 \u043f\u0435\u0440\u0432\u044b\u043c \u0431\u0430\u0433\u043e\u043c \u0438, \u0447\u0442\u043e\u0431\u044b \u0435\u0433\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u043b\u043e\u0433\u0438 \u2014 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0435\u00a0<code>print()<\/code>\u00a0\u0442\u0443\u0442 \u0438 \u0442\u0430\u043c. \u0411\u0430\u0433 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u0438 \u0447\u0430\u0441\u0442\u044c \u043b\u043e\u0433\u043e\u0432 \u0443\u0431\u0440\u0430\u043b\u0438, \u0430 \u0447\u0430\u0441\u0442\u044c \u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u043d\u0430 \u0431\u0443\u0434\u0443\u0449\u0435\u0435 \u2014 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435, \u0435\u0449\u0451 \u043f\u0440\u0438\u0433\u043e\u0434\u044f\u0442\u0441\u044f.<\/p>\n<p>\u0421\u043f\u0443\u0441\u0442\u044f \u043f\u0430\u0440\u0443 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0432 Xcode \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u043e\u0434\u043e\u043f\u0430\u0434 \u0438\u0437 \u043b\u043e\u0433\u043e\u0432. \u0412 \u043d\u0438\u0445 \u0441\u043b\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0432 \u043d\u0438\u0445 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442\u0435 \u044d\u0442\u043e \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u0438 \u0432 \u043d\u043e\u0432\u044b\u0435 \u043b\u043e\u0433\u0438 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043c\u0430\u0440\u043a\u0435\u0442\u044b \u043f\u043e \u0442\u0438\u043f\u0443\u00a0<code>\"----->\"<\/code>\u00a0\u0438\u043b\u0438 \u0435\u0449\u0451 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0432 \u044d\u0442\u043e\u043c \u0434\u0443\u0445\u0435 \u2014 \u0442\u0430\u043a \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0442\u044c \u0432 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435.<\/p>\n<p>\u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u0440\u043e\u0432\u043d\u043e \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442. \u0412 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0435 \u0432\u044b\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0435 \u0438 \u0447\u0438\u0441\u0442\u0438\u0442\u0435 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445, \u043f\u043e \u0432\u0430\u0448\u0435\u043c\u0443 \u043c\u043d\u0435\u043d\u0438\u044e, \u043b\u043e\u0433\u043e\u0432, \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0437\u0430\u0446\u0435\u043f\u043b\u044f\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0438\u043c\u0438 \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u0432\u0430\u0441 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043b\u043e\u0433\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442. \u041a\u0430\u043a\u043e\u0432\u0430 \u0438\u0445 \u0446\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u2014 \u043d\u0435 \u044f\u0441\u043d\u043e.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a Apple \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0440\u0435\u0448\u0430\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443.<\/p>\n<h2>Console.app<\/h2>\n<p>Apple \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u043b\u043e\u0433\u0438 \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u2014 Console.app, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u0432 macOS. \u041d\u043e \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0441 \u0432\u0430\u0448\u0438\u043c \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u0442\u043e \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0435\u0449\u0451 \u0431\u043e\u0301\u043b\u044c\u0448\u0443\u044e \u043f\u043e\u0440\u0442\u044f\u043d\u043a\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439: \u0442\u0443\u0442 \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043b\u043e\u0433\u0438, \u0438 \u043b\u043e\u0433\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0439\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u0440\u0430\u0432\u0430 \u0441\u0432\u0435\u0440\u0445\u0443 \u0435\u0441\u0442\u044c \u043f\u043e\u043b\u0435 \u043f\u043e\u0438\u0441\u043a\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 LogsDemo, \u0442\u0430\u043a \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0435\u0433\u043e \u0438 \u0432\u0432\u043e\u0436\u0443 \u0432 \u043f\u043e\u043b\u0435 \u043f\u043e\u0438\u0441\u043a\u0430:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0443\u0441\u0442\u043e. \u042d\u0442\u043e \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e <code>print()<\/code> \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043b\u043e\u0433 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c Xcode, \u0430 Console.app \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0447\u0438\u0442\u0430\u0442\u044c \u043b\u043e\u0433\u0438 \u0438\u0437 \u043b\u043e\u0433-\u0444\u0430\u0439\u043b\u043e\u0432. \u0427\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0438\u0441\u044c \u0448\u043b\u0430 \u0432 \u044d\u0442\u0438 \u0441\u0430\u043c\u044b\u0435 \u043b\u043e\u0433-\u0444\u0430\u0439\u043b\u044b, \u043d\u0443\u0436\u043d\u043e <code>print()<\/code> \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 <code>os_log()<\/code>. Apple \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u044d\u0442\u043e \u0447\u0430\u0441\u0442\u044c\u044e <a href=\"https:\/\/developer.apple.com\/documentation\/os\/logging\">Unified Logging System<\/a>.<\/p>\n<p>\u0417\u0430\u043c\u0435\u043d\u044f\u0435\u043c, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a:<\/p>\n<pre><code class=\"swift\">let message = \"\u041d\u0430\u0448\u0435 \u0441 \u0432\u0430\u043c\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u043f\u0430\u0434\u0451\u0442 \u0432 \u043b\u043e\u0433\u0438\"  \/\/ \u0432\u044b\u0437\u043e\u0432 os_log \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 OSLog let osLog = OSLog(subsystem: \"LogsDemo\", category: \"\")   os_log(.debug, \/\/ \u0433\u043e\u0432\u043e\u0440\u0438\u043c, \u0447\u0442\u043e \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043b\u043e\u0433\u0430 \u0431\u0443\u0434\u0435\u0442 'debug' log: osLog, \/\/ \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u0438\u043d\u0441\u0442\u0430\u043d\u0441 OSLog \"%{public}@\", message as! CVarArg) \/\/ \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u043d\u0430\u0448\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435<\/code><\/pre>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c: \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c Xcode \u043b\u043e\u0433\u0438 \u043f\u0430\u0434\u0430\u044e\u0442, \u0430 \u0432 Console.app \u0432\u0441\u0451 \u0435\u0449\u0451 \u043d\u0435\u0442.<\/p>\n<h3>\u0423\u0440\u043e\u0432\u043d\u0438 \u043b\u043e\u0433\u043e\u0432<\/h3>\n<p>\u041b\u043e\u0433\u0438 \u0443\u0440\u043e\u0432\u043d\u044f <code>.debug<\/code> \u043d\u0435 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043b\u043e\u0433-\u0444\u0430\u0439\u043b, \u0430 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0443\u043b\u0435\u0442\u0430\u0435\u0442 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c Xcode. \u0427\u0442\u043e\u0431\u044b \u043b\u043e\u0433 \u0434\u043e\u043b\u0435\u0442\u0435\u043b \u0434\u043e \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439.<\/p>\n<p>\u0412\u0441\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u0435\u0439 \u043f\u044f\u0442\u044c:<\/p>\n<pre><code class=\"swift\">public static let `default`: OSLogType public static let info: OSLogType public static let debug: OSLogType public static let error: OSLogType public static let fault: OSLogType<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043a\u0430 \u0443\u043a\u0430\u0436\u0435\u043c <code>.default<\/code> \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u0441\u0451 \u0435\u0449\u0451 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043b\u043e\u0433\u0438 \u2014 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u044b \u0432 \u043f\u043e\u043b\u0435 \u043f\u043e\u0438\u0441\u043a\u0430 \u0441\u043a\u0430\u0437\u0430\u043b\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u043b\u043e\u0433\u0438 \u043e\u0442 LogsDemo. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u044d\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0438 \u043b\u043e\u0433\u0438 \u043e\u0442 iOS, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043b\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u0432 \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0443\u0445\u0438.<\/p>\n<h4>\u0424\u0438\u043b\u044c\u0442\u0440\u044b<\/h4>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u0442\u043e\u0447\u043d\u0438\u043c \u0444\u0438\u043b\u044c\u0442\u0440. \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b:<\/p>\n<figure class=\"\"><figcaption>\u0412\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0438 \u043d\u0438\u0436\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f.  <\/figcaption><\/figure>\n<p>\u041d\u0430\u043c \u043f\u043e\u0434\u043e\u0439\u0434\u0443\u0442 <code>Library<\/code>, <code>Equals<\/code>:<\/p>\n<figure class=\"full-width\"><figcaption>\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u043b\u043e\u0433\u0438 \u0438\u0437 \u0434\u0435\u043c\u043e-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/figcaption><\/figure>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u0434\u043e. \u041d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0432 \u043f\u043e\u0438\u0441\u043a\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0443\u0442\u043e\u0447\u043d\u044f\u0442\u044c \u0444\u0438\u043b\u044c\u0442\u0440 \u2014 \u043b\u0435\u043d\u044c. \u0425\u043e\u0440\u043e\u0448\u043e, \u0447\u0442\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c: \u043f\u0440\u044f\u043c\u043e \u043f\u043e\u0434 \u043f\u043e\u043b\u0435\u043c \u043f\u043e\u0438\u0441\u043a\u0430 \u0435\u0441\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0430 Save. \u041d\u0430\u0436\u0438\u043c\u0430\u0435\u043c, \u0432\u0432\u043e\u0434\u0438\u043c \u0438\u043c\u044f \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0438 \u043e\u043d \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0442\u0443\u043b\u0431\u0430\u0440\u0435:<\/p>\n<figure class=\"full-width\"><figcaption>\u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0436\u0438\u0432\u0443\u0449\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0434\u043b\u044f \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0414\u043e\u0434\u043e \u041f\u0438\u0446\u0446\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u0441\u0432\u043e\u0438\u0445 \u043f\u0435\u0442-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.<\/figcaption><\/figure>\n<p>\u041c\u043e\u0436\u043d\u043e \u0434\u0430\u0436\u0435 \u0444\u0438\u043b\u044c\u0442\u0440 \u0432\u043e\u0442\u043a\u043d\u0443\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0438. \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0435 \u043c\u0435\u043d\u044e \u043b\u043e\u0433\u0430 \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0438 \u043f\u0440\u043e\u0441\u0438\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0448\u0438\u0431\u043a\u0438:<\/p>\n<figure class=\"\"><figcaption>\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0435 \u043c\u0435\u043d\u044e \u0443 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0441\u0432\u043e\u0451. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0443\u043d\u043a\u0442\u044b \u0441 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0435\u0439 \u043f\u043e \u043f\u043e\u043b\u044e Type, \u043d\u0443\u0436\u043d\u043e \u043a\u043b\u0438\u043a\u043d\u0443\u0442\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e \u043a\u043e\u043b\u043e\u043d\u043a\u0435 Type.<\/figcaption><\/figure>\n<p>\u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u0433\u0438 \u0441 \u0443\u0440\u043e\u0432\u043d\u0435\u043c <code>.error:<\/code><\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h3>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043b\u043e\u0433\u0430<\/h3>\n<p>\u0413\u043e\u0440\u0430\u0437\u0434\u043e \u0447\u0430\u0449\u0435 \u043f\u0440\u0438 \u0434\u0435\u0431\u0430\u0433\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0435 \u00ab\u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0448\u0438\u0431\u043a\u0438\u00bb, \u0430 \u043b\u043e\u0433\u0438 \u00ab\u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f N\u00bb. \u041c\u044b \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u0438\u043b\u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0414\u043e\u0434\u043e \u041f\u0438\u0446\u0446\u044b \u043d\u0430 \u043c\u043e\u0434\u0443\u043b\u0438 \u2014 \u0438\u0445 \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 62. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u0433\u0438 \u0438\u0437 \u0441\u0435\u0442\u0438 \u2014 \u0432\u043f\u043e\u043b\u043d\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u043b\u044f \u043d\u0430\u0441 \u043a\u0435\u0439\u0441. \u0412 \u0434\u0435\u043c\u043e-\u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c Network, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u043c \u043b\u043e\u0433\u0438 \u0434\u043e \u043d\u0435\u0433\u043e. \u041d\u043e \u043e\u0442\u043a\u0443\u0434\u0430 \u0432\u0437\u044f\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f? \u0418 \u043a\u0443\u0434\u0430 \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c? \u041f\u0438\u0441\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0437\u0432\u0443\u0447\u0438\u0442 \u043a\u0430\u043a \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430. \u0414\u0430 \u0438 \u0435\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u0441 \u043a\u043e\u0434\u043e\u043c \u043c\u0435\u0436\u0434\u0443 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0431\u044b\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>\u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u044f \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u0435\u0437 \u043d\u0430\u043f\u0440\u044f\u0433\u0430? \u0415\u0433\u043e \u0432\u0435\u0440\u043d\u0451\u0442 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>#fileID<\/code>:<\/p>\n<pre><code class=\"swift\">let fileID: StaticString = #fileID \/\/ \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 LogsDemo\/ViewController.swift  let module = URL(fileURLWithPath: self).deletingPathExtension().pathComponents[1] \/\/ \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 LogsDemo<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432 <a href=\"http:\/\/console.app\/\">Console.app<\/a> \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0438\u043b\u044c\u0442\u0440 \u043f\u043e <code>Subsystem: Network<\/code> \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043b\u043e\u0433\u0438 \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f <code>Network<\/code>:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c \u0437\u043d\u0430\u0435\u043c. \u0427\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435?<\/p>\n<ol>\n<li>\n<p>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f, \u043f\u0440\u044f\u043c\u043e \u0438\u0437 <code>#fileID<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0438\u0437 <code>#function<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0442\u0440\u043e\u0447\u043a\u0443 \u0438\u0437 <code>#line<\/code>.<\/p>\n<\/li>\n<\/ol>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u043a\u043b\u0435\u0438\u0432\u0430\u0435\u043c \u044d\u0442\u043e \u0432\u0441\u0451 \u0432 \u043e\u0434\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435:<\/p>\n<pre><code class=\"swift\">\/\/ \u0420\u0430\u043d\u044c\u0448\u0435 \u0432 OSLog \u0432 \u043f\u043e\u043b\u0435 subsystem \u043c\u044b \u043f\u043e\u0434\u0430\u0432\u0430\u043b\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \/\/ \u041d\u043e \u043e\u043d\u043e \u0438 \u0442\u0430\u043a \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0432 \u043b\u043e\u0433\u0438 \u0432 \u043f\u043e\u043b\u0435 Library \/\/ \u0422\u0430\u043a \u0447\u0442\u043e \u043c\u044b \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0430\u0451\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f let osLog = OSLog(subsystem: module, category: \"\")  let fileFunction = [filename, function].joined(separator: \".\") let source = [fileFunction, line].joined(separator: \":\")  let formattedMessage = [source, message].joined(separator: \"\\n\\n\")  os_log(.default,        log: osLog,        \"%{public}@\", formattedMessage) <\/code><\/pre>\n<p>\u0412 Console.app \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0432 \u043a\u0430\u043a\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435, \u0432 \u043a\u0430\u043a\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0438 \u043d\u0430 \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e. \u041d\u0443, \u0435\u0441\u043b\u0438 \u0437\u0430\u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043b\u0438.<\/p>\n<h3>\u0410 \u0447\u0442\u043e \u0435\u0449\u0451 \u043c\u043e\u0436\u043d\u043e?<\/h3>\n<p>\u0414\u0430 \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u2014 <code>os_log<\/code> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043b\u044e\u0431\u043e\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0435\u0433\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c.<\/p>\n<p>\u041e\u0448\u0438\u0431\u043a\u0443? \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430:<\/p>\n<pre><code class=\"swift\">enum TaxCalculationError: Error {     case invalidTaxConfig }  let message = String(reflecting: TaxCalculationError.invalidTaxConfig) os_log(.error,        log: logger,        \"%{public}@\", message) <\/code><\/pre>\n<p>\u0417\u0430\u043c\u0435\u0440? \u0422\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e:<\/p>\n<pre><code class=\"swift\">\/\/ \u043b\u043e\u0433\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0430\u0440\u0442 let startMessage = \"Will get profile\"  \/\/ \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0434\u043b\u044f \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u043d\u0435\u0442, \u0442\u0430\u043a \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 os_log(.default,         log: logger,        \"%{public}@\", startMessage)    \/\/ \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0432\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u043d\u0430\u0447\u0430\u043b\u0438 let startDate = Date()  \/\/ \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0434\u043e\u043b\u0433\u0438\u0439 \u043a\u043e\u0434 let response = networkService.data(for: ProfileRequest()) let profileModel = ProfileModel(response)  \/\/ \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0432\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438 let endDate = Date()  \/\/ \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0435 \u0438 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f  let duration = endDate.timeInterval(since: startDate) let durationFormatter = String(format: \"%.2f\", duration)  \/\/ \u043b\u043e\u0433\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043d\u0435\u0446 \u0441 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e let endMessage = \"Got profile, took \\(durationFormatter)s\" os_log(.default,        log: logger,        \"%{public}@\", endMessage) <\/code><\/pre>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0421\u0432\u044f\u0437\u043a\u0430 <code>os_log<\/code> \u0438 Console.app \u2014 \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0441\u043b\u043e\u0439 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0432 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0448\u0438\u0431\u043a\u0438, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0437\u0430\u043c\u0435\u0440\u0438\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0443 \u0432\u0430\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u0442\u0430 \u0438\u043b\u0438 \u0438\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u044d\u0442\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0432 \u043b\u043e\u0433\u0438.<\/p>\n<p>\u041d\u043e \u0434\u043b\u044f \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0441\u043e\u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. \u0411\u043e\u0439\u043b\u0435\u0440\u043f\u043b\u0435\u0439\u0442\u0430, \u0443\u0436 \u043f\u0440\u043e\u0441\u0442\u0438\u0442\u0435 \u043c\u043d\u0435 \u044d\u0442\u043e \u0441\u043b\u043e\u0432\u043e. \u041d\u0430\u0434\u043e \u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c, \u0438 \u0437\u0430\u043c\u0435\u0440\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a\u0430\u043a-\u0442\u043e \u0435\u0449\u0451 \u043f\u0440\u0438\u043f\u0438\u0445\u043d\u0443\u0442\u044c. \u041a\u0430\u043a \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u2014 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439. \u041f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c, \u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043b\u0430\u0439\u043a\u0438, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0439\u0442\u0435 \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u0434\u0440\u0443\u0437\u044c\u044f\u043c.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/dododev\/blog\/689758\/\"> https:\/\/habr.com\/ru\/company\/dododev\/blog\/689758\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-338925","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/338925","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=338925"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/338925\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=338925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=338925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=338925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}