Minor refactor of simple log function