revise log handling

All the log-related operations are calling functions in util.go. This makes
the consistancy of the logs.