When to use drush_log() or drush_set_error()? I just trying to show an error message with drush and I see that you can achieve this with

drush_set_error('NON_EXISTENT', 'Message');


and with

drush_log('Message', 'error');


In both cases you will see the same error message, I read the functions documentation but I can't figure out are the differences between they?
In general, you should avoid using the status code 'error' when calling drush_log directly. Use drush_log to signal non-terminal events, usually with a status code of warning or notice.

If a function fails and cannot continue, the best thing to do is to exit with return drush_set_error(...);. This sets internal state, so that Drush knows that there was an unrecoverable error, and calls through to drush_log('Message', 'error');.