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.
Add test to check for debug logging disabled at compile time
auto merge of #10768 : Blei/rust/logging-enabled-macros, r=alexcrichton

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