alinaliBQ commented on code in PR #47645:
URL: https://github.com/apache/arrow/pull/47645#discussion_r2377214101


##########
cpp/src/arrow/flight/sql/odbc/CMakeLists.txt:
##########
@@ -17,5 +17,10 @@
 
 add_custom_target(arrow_flight_sql_odbc)
 
+# Use C++ 20 for ODBC and its subdirectory
+# GH-44792: Arrow will switch to C++ 20
+set(CMAKE_CXX_STANDARD 20)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)

Review Comment:
   This change is duplicated at https://github.com/apache/arrow/pull/47517. But 
it is required to fix the build. After this PR is merged, I will remove 
duplication at https://github.com/apache/arrow/pull/47517



##########
cpp/src/arrow/flight/sql/odbc/flight_sql/ui/dsn_configuration_window.cc:
##########
@@ -280,7 +280,7 @@ int 
DsnConfigurationWindow::CreateEncryptionSettingsGroup(int posX, int posY, in
       rightCheckPosX, rowPos - 2, 20, 2 * ROW_HEIGHT, "",
       ChildId::DISABLE_CERT_VERIFICATION_CHECKBOX, disableCertVerification);
 
-  rowPos += INTERVAL + static_cast<int>(1.5 * ROW_HEIGHT);
+  rowPos += INTERVAL + static_cast<int>(1.5 * static_cast<int>(ROW_HEIGHT));

Review Comment:
   This change is duplicated at https://github.com/apache/arrow/pull/47517. But 
it is required to fix the build. After this PR is merged, I will remove 
duplication at https://github.com/apache/arrow/pull/47517



##########
cpp/src/arrow/flight/sql/odbc/flight_sql/flight_sql_driver.cc:
##########
@@ -63,45 +67,15 @@ odbcabstraction::Diagnostics& 
FlightSqlDriver::GetDiagnostics() { return diagnos
 void FlightSqlDriver::SetVersion(std::string version) { version_ = 
std::move(version); }
 
 void FlightSqlDriver::RegisterLog() {
-  odbcabstraction::PropertyMap propertyMap;
-  driver::odbcabstraction::ReadConfigFile(propertyMap, CONFIG_FILE_NAME);
-
-  auto log_enable_iterator = propertyMap.find(SPDLogger::LOG_ENABLED);
-  auto log_enabled = log_enable_iterator != propertyMap.end()
-                         ? odbcabstraction::AsBool(log_enable_iterator->second)
-                         : false;
-  if (!log_enabled) {
-    return;
-  }
-
-  auto log_path_iterator = propertyMap.find(SPDLogger::LOG_PATH);
-  auto log_path = log_path_iterator != propertyMap.end() ? 
log_path_iterator->second : "";
-  if (log_path.empty()) {
+  std::string log_level_str = 
arrow::internal::GetEnvVar(ODBC_LOG_LEVEL).ValueOr("");
+  if (log_level_str.empty()) {
     return;
   }
+  auto log_level = ToLogLevel(std::stoi(log_level_str));
 
-  auto log_level_iterator = propertyMap.find(SPDLogger::LOG_LEVEL);
-  auto log_level = ToLogLevel(log_level_iterator != propertyMap.end()
-                                  ? std::stoi(log_level_iterator->second)
-                                  : 1);
-  if (log_level == odbcabstraction::LogLevel_OFF) {
-    return;
-  }
-
-  auto maximum_file_size_iterator = 
propertyMap.find(SPDLogger::MAXIMUM_FILE_SIZE);
-  auto maximum_file_size = maximum_file_size_iterator != propertyMap.end()
-                               ? std::stoi(maximum_file_size_iterator->second)
-                               : DEFAULT_MAXIMUM_FILE_SIZE;
-
-  auto maximum_file_quantity_iterator = 
propertyMap.find(SPDLogger::FILE_QUANTITY);
-  auto maximum_file_quantity = maximum_file_quantity_iterator != 
propertyMap.end()
-                                   ? 
std::stoi(maximum_file_quantity_iterator->second)
-                                   : 1;
-
-  std::unique_ptr<odbcabstraction::SPDLogger> logger(new 
odbcabstraction::SPDLogger());
-
-  logger->init(maximum_file_quantity, maximum_file_size, log_path, log_level);
-  odbcabstraction::Logger::SetInstance(std::move(logger));
+  // Enable driver logging. Log files are not supported on Windows yet, since 
GLOG is not
+  // tested fully on Windows.
+  arrow::util::ArrowLog::StartArrowLog("arrow-flight-sql-odbc", log_level);

Review Comment:
   Logging documentation is available at 
https://github.com/apache/arrow/pull/46099 (see 
[here](https://github.com/apache/arrow/pull/46099/commits/83c7a744606e4cf7e725c719404d3fc571710967#diff-dfecfcd0d12d6c9cca37c1b7e501584413de1f0a1e442a49faaea7caff5395d2)).
 We plan to add the docs in future PRs



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to