Add a macro to check if logging at a given label is enabled

This is useful when the information that is needed to do useful logging
is expensive to produce.