Fix long-standing problems with ostream manipulators (std::endl, for example) and LogNull.
Fix long-standing problems with ostream manipulators (std::endl, for example)
and LogNull.

While here, add some consts and fix some style issues.


wanproxy/wanproxy,wanproxy/wanproxy,wanproxy/wanproxy