Optimize continuous logging to avoid large log size

Commit 3d485f9 added excessive logging that generates large log files
(28 MB in 1 day). This will reduce the logging to only log when
necessary, and to log the least number of bits in continuous logging.