use $log for logging rather than console