Skip to content
Browse files

added CLCG_LOG macro. Plus shorter synonyms for others.

  • Loading branch information...
1 parent 135b831 commit 6a83254b431d618b524441f4b08cd5ed74635320 @ettore committed Nov 23, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 clcg_debug.h
View
14 clcg_debug.h
@@ -39,29 +39,42 @@ extern "C" {
///////////////////////////////////////////////////////////////////////////////
+// logging macro
+
+#define CLCG_LOG(xx, ...) NSLog(@"%s(%d): " xx, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
+#define CLCGLOG CLCG_LOG
+
+
+///////////////////////////////////////////////////////////////////////////////
// debugging macros
+
#ifdef DEBUG
#define CLCG_P(xx, ...) NSLog(@"%s(%d): " xx, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define CLCG_P(xx, ...) ((void)0)
#endif
+#define CLCGP CLCG_P
+/* e.g. CLCG_PSIZE(@"screen bounds", [[UIScreen mainScreen] bounds]); */
#ifdef DEBUG
#define CLCG_PRECT(s,r) NSLog(@"%s(%d): %@ (%.0f,%.0f) (%.0f,%.0f)", __PRETTY_FUNCTION__, \
__LINE__, s, r.origin.x, r.origin.y, r.size.width, r.size.height)
#else
#define CLCG_PRECT(s,r) ((void)0)
#endif
+#define CLCGPR CLCG_PRECT
+/* e.g. CLCG_PSIZE(@"screen size", [[UIScreen mainScreen] bounds].size); */
#ifdef DEBUG
#define CLCG_PSIZE(s,r) NSLog(@"%s(%d): %@ (%.0f,%.0f)", __PRETTY_FUNCTION__, \
__LINE__, s, r.width, r.height);
#else
#define CLCG_PSIZE(s,r) ((void)0)
#endif
+#define CLCGPSZ CLCG_PSIZE
///////////////////////////////////////////////////////////////////////////////
@@ -86,6 +99,7 @@ if (am_i_being_debugged()) { __asm__("int $3\n" : : ); }; } \
#else
#define CLCG_ASSERT(xx) ((void)0)
#endif // #ifdef DEBUG
+#define CLCGASSERT CLCG_ASSERT
#ifdef __cplusplus
}

0 comments on commit 6a83254

Please sign in to comment.
Something went wrong with that request. Please try again.