function drush_log_has_errors

8.0.x drush.inc drush_log_has_errors($types = array(LogLevel::WARNING, LogLevel::ERROR, LogLevel::FAILED))
7.x drush.inc drush_log_has_errors($types = array(LogLevel::WARNING, LogLevel::ERROR, LogLevel::FAILED))
master drush.inc drush_log_has_errors($types = array(LogLevel::WARNING, LogLevel::ERROR, LogLevel::FAILED))

Related topics

1 call to drush_log_has_errors()
drush_main in includes/preflight.inc
The main Drush function.

File

includes/drush.inc, line 1295
The drush API implementation and helpers.

Code

function drush_log_has_errors($types = array(LogLevel::WARNING, LogLevel::ERROR, LogLevel::FAILED)) {
  $log = &drush_get_context('DRUSH_LOG', array());
  foreach ($log as $entry) {
    if (in_array($entry['type'], $types)) {
      return TRUE;
    }
  }
  return FALSE;
}