-
Notifications
You must be signed in to change notification settings - Fork 3.9k
GH-47518: [C++][FlightRPC] Replace spdlogs with Arrow's Internal Logging
#47645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* 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
|
|
| # 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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
@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. |
There was a problem hiding this 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); |
There was a problem hiding this comment.
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()?
There was a problem hiding this comment.
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
This reverts commit 93f095c. The logic is flawed.
The default log level is INFO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
| // Info log level is enabled by default. | ||
| if (log_level != ArrowLogLevel::ARROW_INFO) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
spdlogs with Arrow's Internal Loggingspdlogs with Arrow's Internal Logging
|
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. |
…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]>
Rationale for this change
Replace
spdlogswith Arrow's Internal Logging.What changes are included in this PR?
spdlogsfetch and buildAre these changes tested?
Are there any user-facing changes?
No