OmniSciDB  a987f07e93
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Geospatial::anonymous_namespace{GDAL.cpp} Namespace Reference

Functions

void gdal_error_handler (CPLErr err_class, int err_no, const char *err_msg)
 

Function Documentation

void Geospatial::anonymous_namespace{GDAL.cpp}::gdal_error_handler ( CPLErr  err_class,
int  err_no,
const char *  err_msg 
)

Definition at line 39 of file GDAL.cpp.

References CHECK, logger::ERROR, logger::INFO, LOG, and to_string().

Referenced by Geospatial::GDAL::init().

39  {
40  CHECK(err_class >= CE_None && err_class <= CE_Fatal);
41  if (err_no == CPLE_NotSupported) {
42  // squash these
43  return;
44  }
45  static constexpr std::array<const char*, 5> err_class_strings{
46  "Info",
47  "Debug",
48  "Warning",
49  "Failure",
50  "Fatal",
51  };
52  std::string log_msg = std::string("GDAL ") + err_class_strings[err_class] + ": " +
53  err_msg + " (" + std::to_string(err_no) + ")";
54  if (err_class >= CE_Failure) {
55  LOG(ERROR) << log_msg;
56  } else {
57  LOG(INFO) << log_msg;
58  }
59 }
#define LOG(tag)
Definition: Logger.h:283
std::string to_string(char const *&&v)
#define CHECK(condition)
Definition: Logger.h:289

+ Here is the call graph for this function:

+ Here is the caller graph for this function: