Use macro for optimization logger.