some improvements in log.h