@@ -22,6 +22,12 @@ limitations under the License.
22
22
#include " absl/strings/ascii.h"
23
23
#include " absl/strings/str_cat.h"
24
24
#include " absl/synchronization/mutex.h"
25
+ // TODO: Restore logging.h
26
+ #define TF_Log (...)
27
+ #define TF_VLog (...)
28
+ // #include "tensorflow/c/logging.h"
29
+ // TODO: Restore logging.h
30
+ #include " tensorflow/c/tf_status.h"
25
31
#include " tensorflow_io/core/plugins/file_system_plugins.h"
26
32
27
33
namespace tensorflow {
@@ -473,20 +479,21 @@ class CurlHttpRequest {
473
479
const auto starttransfer_time_status = curl_easy_getinfo (
474
480
that->curl_ , CURLINFO_STARTTRANSFER_TIME, &starttransfer_time);
475
481
476
- // TODO: Use C API from TensorFlow for Logging.
477
- // LOG(ERROR) << "The transmission of request " << this_object
478
- // << " (URI: " << that->uri_ << ") has been stuck at "
479
- // << current_progress << " of " << dltotal + ultotal
480
- // << " bytes for " << now - that->last_progress_timestamp_
481
- // << " seconds and will be aborted. CURL timing information: "
482
- // << "lookup time: " << lookup_time << " ("
483
- // << curl_easy_strerror(lookup_time_status)
484
- // << "), connect time: " << connect_time << " ("
485
- // << curl_easy_strerror(connect_time_status)
486
- // << "), pre-transfer time: " << pretransfer_time << " ("
487
- // << curl_easy_strerror(pretransfer_time_status)
488
- // << "), start-transfer time: " << starttransfer_time << " ("
489
- // << curl_easy_strerror(starttransfer_time_status) << ")";
482
+ std::string error_message = absl::StrCat (
483
+ " The transmission of request " , (int64_t )(this_object),
484
+ " (URI: " , that->uri_ , " ) has been stuck at " , current_progress,
485
+ " of " , dltotal + ultotal, " bytes for " ,
486
+ now - that->last_progress_timestamp_ ,
487
+ " seconds and will be aborted. CURL timing information: " ,
488
+ " lookup time: " , lookup_time, " (" ,
489
+ curl_easy_strerror (lookup_time_status),
490
+ " ), connect time: " , connect_time, " (" ,
491
+ curl_easy_strerror (connect_time_status),
492
+ " ), pre-transfer time: " , pretransfer_time, " (" ,
493
+ curl_easy_strerror (pretransfer_time_status),
494
+ " ), start-transfer time: " , starttransfer_time, " (" ,
495
+ curl_easy_strerror (starttransfer_time_status), " )" );
496
+ TF_Log (TF_ERROR, error_message.c_str ());
490
497
return 1 ; // Will abort the request.
491
498
}
492
499
// No progress was made since the last call, but we should wait a bit
0 commit comments