Skip to content

Conversation

@alinaliBQ
Copy link
Contributor

@alinaliBQ alinaliBQ commented Sep 24, 2025

Rationale for this change

Replace spdlogs with Arrow's Internal Logging.

What changes are included in this PR?

  • removed spdlogs fetch and build
  • replaced odbc logging framework with Arrow's internal logging
  • Build fixes:
    • use C++ 20
    • dsn window minor static cast fix

Are these changes tested?

  • yes, on local Windows environment

Are there any user-facing changes?

No

* Add logging README

* register kernel function conditionally

   * Resolves errors of kernel function already registered

Logging files are not supported since GLOG is not enabled on Windows in Arrow repo. We can work + test on log file support on macOS/Linux phase

* Added minor changes to fix the build
@github-actions
Copy link

⚠️ GitHub issue #47518 has been automatically assigned in GitHub to PR creator.

@alinaliBQ alinaliBQ marked this pull request as ready for review September 24, 2025 22:23
@alinaliBQ alinaliBQ requested a review from lidavidm as a code owner September 24, 2025 22:23
Comment on lines 20 to 23
# 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)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is duplicated at #47517. But it is required to fix the build. After this PR is merged, I will remove duplication at #47517

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));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is duplicated at #47517. But it is required to fix the build. After this PR is merged, I will remove duplication at #47517

Comment on lines 76 to 78
// 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);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logging documentation is available at #46099 (see here). We plan to add the docs in future PRs

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Sep 24, 2025
@alinaliBQ
Copy link
Contributor Author

@lidavidm @kou Please have a look at this PR. It addresses code review comment at #47517 (comment). I separated the change in a different PR as the change is big to make it easier to review.

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting committer review Awaiting committer review labels Sep 25, 2025
@lidavidm lidavidm requested a review from kou September 25, 2025 07:34
@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting merge Awaiting merge labels Sep 25, 2025
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Sep 25, 2025
Copy link
Contributor Author

@alinaliBQ alinaliBQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed comments from Sutou

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we call paired arrow::util::ArrowLog::ShutdownArrowLog()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I have added call to it in the FlightSqlDriver destructor. Currently calling ShutdownArrowLog will have no impact as the function shuts down glog, and the driver doesn't support glog logging yet. I think it makes sense to call ShutdownArrowLog since arrow community might make logging changes in the future

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Sep 26, 2025
@github-actions github-actions bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Sep 26, 2025
@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting change review Awaiting change review labels Sep 27, 2025
Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Comment on lines +82 to +83
// Info log level is enabled by default.
if (log_level != ArrowLogLevel::ARROW_INFO) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to enable logging only on INFO log level, right?
I think removing this condition (why do we need to disable?) or using log_level <= ArrowLogLevel::ARROW_INFO (disable all not important logs) is better. But we can revisit this later if it's needed.

Copy link
Contributor Author

@alinaliBQ alinaliBQ Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that let's revisit this later. We do want to enable all kinds of logging. This condition is actually more for tests, not for disabling logging. I found that the enable log command was called multiple times, so I added this condition in hopes to reduce the number of times the logging starts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

INFO logging is enabled in Arrow logging framework by default. I have tested this. So to ensure logging is enabled, we only need to call StartArrowLog if the log level is not INFO.

@kou kou changed the title GH-47518: [C++][FlightRPC] Replace spdlogs with Arrow's Internal Logging GH-47518: [C++][FlightRPC] Replace spdlogs with Arrow's Internal Logging Sep 27, 2025
@kou kou merged commit 9b96bdb into apache:main Sep 27, 2025
42 of 43 checks passed
@kou kou removed the awaiting merge Awaiting merge label Sep 27, 2025
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 9b96bdb.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 2 possible false positives for unstable benchmarks that are known to sometimes produce them.

@github-actions github-actions bot added the awaiting committer review Awaiting committer review label Sep 29, 2025
zanmato1984 pushed a commit to zanmato1984/arrow that referenced this pull request Oct 15, 2025
…nal Logging (apache#47645)

### Rationale for this change
 Replace `spdlogs` with Arrow's Internal Logging. 

### What changes are included in this PR?
- removed `spdlogs` fetch and build
- replaced odbc logging framework with Arrow's internal logging
- Build fixes:
    - use C++ 20
    - dsn window minor static cast fix

### Are these changes tested?
- yes, on local Windows environment

### Are there any user-facing changes?
No
* GitHub Issue: apache#47518

Lead-authored-by: Alina (Xi) Li <[email protected]>
Co-authored-by: Alina (Xi) Li <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
@alinaliBQ alinaliBQ deleted the gh-47518-odbc-remove-spd-logs branch October 27, 2025 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants