maybe a macro? same way it is done for logging