Cleanup warning/error diagnostics.  Print them to stderr.
Rework logging code so it produces correct results.
Doc fix.