Using angular's $log service