use autoclosure for logMessage so that parameters aren't evalutated if logging is disabled