How to return drupal error message in php cli
Since you are using the command line, have a look at PHP's input/output streams. These let you write data out to where your environment would be expecting to receive output. 

Alternatively, you might want a look at Drupal's built-in logging with watchdog(). You can see the messages it generates in Administration >> Reports >> Recent log messages.