Thursday, August 19, 2010

Type-Savvy Logging Macro

Vincent Gable has written a nifty macro that, given an expression, prints the code for the expression and the expression’s value, no matter whether it’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.

Comments RSS · Twitter

Leave a Comment