logging conditionally
adjusted log.h