Don't log the same messages

It avoids too many needless log messages. Too many log messages cause
too much disk I/O. It is a serious performance issue.