Add check macros
Add conditional logging