Allow logging in individual functions even though the global logging option is false. Closes #2571