You are here

protected function BackupMigrateDropboxAPI::log in Backup and Migrate Dropbox 7.3

Logs some debug/tracing/timing information.

Will not be used in official releases, should only be used during development or when problems are researched.

Parameters

object $http_result: See the return value of {@see send_http_request}

File

./backup_migrate_dropbox.dropbox_api.inc, line 802

Class

BackupMigrateDropboxAPI
BackupMigrateDropboxAPI contains all the details about the Dropbox api, authorization calls, endpoints, uris, parameters, error handling, and split requests for large uploads/downloads

Code

protected function log($http_result) {
  $meta = $http_result->meta;
  $url = $meta['url'];
  $method_time = $meta['method_time'];
  $total_time = $meta['total_time'];
  $namelookup_time = $meta['namelookup_time'];
  $connect_time = $meta['connect_time'];
  $transfer_time = $total_time - $meta['starttransfer_time'];
  file_put_contents(DRUPAL_ROOT . '/curl.log', sprintf("%s: %-50s: %.4f %.4f %.4f %.4f %.4f\n", date('c'), $url, $method_time, $total_time, $namelookup_time, $connect_time, $transfer_time), FILE_APPEND);
}