MCPcopy Create free account
hub / github.com/apache/arrow / RegisterLog

Method RegisterLog

cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_driver.cc:73–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73void FlightSqlDriver::RegisterLog() {
74 std::string log_level_str = arrow::internal::GetEnvVar(kODBCLogLevel)
75 .Map(arrow::internal::AsciiToLower)
76 .Map(arrow::internal::TrimString)
77 .ValueOr("");
78 if (log_level_str.empty()) {
79 return;
80 }
81
82 auto log_level = ArrowLogLevel::ARROW_DEBUG;
83
84 if (log_level_str == "fatal") {
85 log_level = ArrowLogLevel::ARROW_FATAL;
86 } else if (log_level_str == "error") {
87 log_level = ArrowLogLevel::ARROW_ERROR;
88 } else if (log_level_str == "warning") {
89 log_level = ArrowLogLevel::ARROW_WARNING;
90 } else if (log_level_str == "info") {
91 log_level = ArrowLogLevel::ARROW_INFO;
92 } else if (log_level_str == "debug") {
93 log_level = ArrowLogLevel::ARROW_DEBUG;
94 } else if (log_level_str == "trace") {
95 log_level = ArrowLogLevel::ARROW_TRACE;
96 }
97
98 // Enable driver logging. Log files are not supported on Windows yet, since GLOG is not
99 // tested fully on Windows.
100 // Info log level is enabled by default.
101 if (log_level != ArrowLogLevel::ARROW_INFO) {
102 ArrowLog::StartArrowLog("arrow-flight-sql-odbc", log_level);
103 }
104}
105
106} // namespace arrow::flight::sql::odbc

Callers

nothing calls this directly

Calls 4

GetEnvVarFunction · 0.85
ValueOrMethod · 0.80
MapMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected