MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / initGRPCLogging

Function initGRPCLogging

src/Server/GRPCServer.cpp:135–168  ·  view source on GitHub ↗

See also contrib/grpc/src/core/util/log.cc

Source from the content-addressed store, hash-verified

133
134 /// See also contrib/grpc/src/core/util/log.cc
135 void initGRPCLogging(const Poco::Util::AbstractConfiguration & config)
136 {
137 static std::once_flag once_flag;
138 std::call_once(once_flag, [&config]
139 {
140 absl::AddLogSink(&grpc_log_sink);
141 absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfinity);
142 absl::InitializeLog();
143
144 absl::SetStderrThreshold(absl::LogSeverityAtLeast::kInfinity);
145
146 const bool verbose = config.getBool("grpc.verbose_logs", false);
147 static LoggerRawPtr logger = getRawLogger("grpc");
148
149 if (verbose)
150 grpc_tracer_set_enabled("all", true);
151
152 if (logger->is(Poco::Message::PRIO_DEBUG))
153 {
154 absl::SetMinLogLevel(absl::LogSeverityAtLeast::kInfo);
155 absl::SetVLogLevel("*grpc*/*", 2);
156 }
157 else if (logger->is(Poco::Message::PRIO_INFORMATION))
158 {
159 absl::SetMinLogLevel(absl::LogSeverityAtLeast::kInfo);
160 absl::SetVLogLevel("*grpc*/*", -1);
161 }
162 else
163 {
164 absl::SetMinLogLevel(absl::LogSeverityAtLeast::kWarning);
165 absl::SetVLogLevel("*grpc*/*", -1);
166 }
167 });
168 }
169
170 /// Gets file's contents as a string, throws an exception if failed.
171 String readFile(const String & filepath)

Callers 1

startMethod · 0.85

Calls 3

getRawLoggerFunction · 0.85
getBoolMethod · 0.45
isMethod · 0.45

Tested by

no test coverage detected