function usage_drush_exit

8.0.x usage_drush_exit()
6.x usage_drush_exit()
7.x usage_drush_exit()
5.x usage_drush_exit()

Log and/or send usage data to Mongolab.

An organization can implement own hook_drush_exit() to send data to a different endpoint.


commands/core/, line 46
Send scrubbed usage data to drush. Omits arguments and option values in order to assure that no sensitive data is shared. See


function usage_drush_exit() {
  // Ignore statistics for simulated commands. (n.b. in simulated mode, _drush_usage_mongolab will print rather than send statistics)
  if (!drush_get_context('DRUSH_SIMULATE')) {
    $file = _drush_usage_get_file();
    if (drush_get_option('drush_usage_log', FALSE)) {
      _drush_usage_log(drush_get_command(), $file);
    if (drush_get_option('drush_usage_send', FALSE)) {
      _drush_usage_mongolab($file, drush_get_option('drush_usage_size', 51200));