Change log level at run time

This change allows you to change the log level at run time. The log level set at compile time cannot be changed at run time, obviously.

I basically copied over the [patch suggested by Luc Simard on Google Groups](https://groups.google.com/forum/?hl=en#!topic/logog/DQPCsXaK-_o), along with some minor tweaks and a unit test.