Will a few if statements really kill your performance anyway? It's only a few more instructions per frame and a few more bytes in memory after all.
In game *servers*, (Cas has already done the client story) you will typically call these more than a hundred thousand times a second, maybe a lot more.
If you have a sensible logging framework, a single logging call is likely to go through several objects and several methods, usually down a filtering chain (have a look at log4J, which IIRC is now part of the standard libs. It's *not* a good logging framework - it's too basic - but it does some things very well. IIRC it has a decent filtering system, allowing you to divert different log-messages to different sinks, multicast them, etc.)
Since your logging framework will tend to be more powerful and complex the more powerful and complex your app/server is, yeah this stuff really matters
...P.S. you guessed right my mistake
. As it happens, we also actually *only* use class-local vars for this - mainly I expect because of your problem
. If I'd found someone who remembered the original results, they'd probably have pointed that out to me in the first place