{"id":3057,"date":"2023-06-06T21:21:38","date_gmt":"2023-06-07T01:21:38","guid":{"rendered":"https:\/\/michaelrowe01.com\/?p=3057"},"modified":"2023-06-06T21:21:41","modified_gmt":"2023-06-07T01:21:41","slug":"debug-with-structured-logging","status":"publish","type":"post","link":"https:\/\/michaelrowe01.com\/index.php\/blog\/debug-with-structured-logging\/","title":{"rendered":"Debug with Structured Logging"},"content":{"rendered":"\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"blob:https:\/\/michaelrowe01.com\/35d952aa-c4c3-4367-9a34-c1509b0c44fa\" alt=\"Screenshot 2023-06-06 at 20.52.59 (2).png\"\/><\/figure>\n\n\n\n<p>New debug console&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Message is the focus not all the prefixes.. so you can add them back in based on metadata options flag.&nbsp; This now shows up below the message<\/li>\n\n\n\n<li>Yellow or Red background is an error and fault<\/li>\n\n\n\n<li>Can also press space on a single log entry.<\/li>\n\n\n\n<li>You can also use filtering so only show what you care about, you will get auto complete view too. You can also right click on a log entry and use it to show similar or hide similar etc.<\/li>\n<\/ul>\n\n\n\n<p>Live debugging<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Demo&nbsp;<\/li>\n<\/ul>\n\n\n\n<p>LLDB Improvements&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use p instead of po so you can get the details of an object<\/li>\n\n\n\n<li>Hard to remember all the new commands.. try dwim-print (or do what I mean print), you can just use \u201cp\u201d instead<\/li>\n\n\n\n<li>Po will now do what I want plus customer object descriptions<\/li>\n<\/ul>\n\n\n\n<p>Tips for logging<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>OSLog is for debugging, print is only for stdio<\/li>\n\n\n\n<li>You should log any tasks being done, along with the results(&nbsp;<\/li>\n\n\n\n<li>You get all the meta data is you use OSLog &#8211; import OSLog in to the project.&nbsp; Define your Logger with a subsystem (your app) and category (your function)<\/li>\n\n\n\n<li>Consider\n<ul class=\"wp-block-list\">\n<li>create multiple log handles for different components&nbsp;<\/li>\n\n\n\n<li>Use OSLogStore for collection in the field<\/li>\n\n\n\n<li>OSLog is a tracing facility &#8211; it can do performance too<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>New debug console&nbsp; Live debugging LLDB Improvements&nbsp; Tips for logging<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"hide_page_title":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[2,3],"tags":[107,111,699,680],"class_list":["post-3057","post","type-post","status-publish","format-standard","hentry","category-blog","category-personal-softwareandit","tag-day-2","tag-debugging","tag-oslog","tag-wwdc23"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2aMa8-Nj","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts\/3057","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/comments?post=3057"}],"version-history":[{"count":1,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts\/3057\/revisions"}],"predecessor-version":[{"id":3058,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/posts\/3057\/revisions\/3058"}],"wp:attachment":[{"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/media?parent=3057"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/categories?post=3057"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michaelrowe01.com\/index.php\/wp-json\/wp\/v2\/tags?post=3057"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}