Hack to force logging to stderr

I couldn't figure out how the stupid logging configuration (which defaults to stdout) is handled, so I'm adding this hack to force everything to stderr, then replace stdout with the original stdout file handle.