{"id":2704,"date":"2010-08-19T11:31:15","date_gmt":"2010-08-19T15:31:15","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=2704"},"modified":"2014-07-14T10:17:02","modified_gmt":"2014-07-14T14:17:02","slug":"type-savvy-logging-macro","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2010\/08\/19\/type-savvy-logging-macro\/","title":{"rendered":"Type-Savvy Logging Macro"},"content":{"rendered":"<p><a href=\"http:\/\/vgable.com\/blog\/2010\/08\/19\/the-most-useful-objective-c-code-ive-ever-written\/\">Vincent Gable<\/a> has written a nifty <a href=\"http:\/\/github.com\/VTPG\/CommonCode\/blob\/master\/VTPG_Common.m\">macro<\/a> that, given an expression, prints the code for the expression and the expression&rsquo;s value, no matter whether it&rsquo;s an object, scalar, or struct. For example, <code>LOG_EXPR(self.window.frame.size)<\/code> prints <code>self.window.frame.size = {320, 480}<\/code>. No need to type format strings or conversion functions.<\/p>","protected":false},"excerpt":{"rendered":"<p>Vincent Gable has written a nifty macro that, given an expression, prints the code for the expression and the expression&rsquo;s value, no matter whether it&rsquo;s an object, scalar, or struct. For example, LOG_EXPR(self.window.frame.size) prints self.window.frame.size = {320, 480}. No need to type format strings or conversion functions.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[69,941,54,74,71],"class_list":["post-2704","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-cocoa","tag-macros","tag-objective-c","tag-opensource","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/2704","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=2704"}],"version-history":[{"count":4,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/2704\/revisions"}],"predecessor-version":[{"id":9144,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/2704\/revisions\/9144"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=2704"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=2704"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=2704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}