Add DEBUG flag for detecting if logging should occur