Optimize out debug log code in nondebug builds

Change-Id: I24625f2d7e966a9fc73862fb65d1e2066059d136