turn off control plane logging unless in debug

This commit is contained in:
Grant Limberg 2023-04-27 09:11:57 -07:00
parent a16d9abb79
commit 73a14b4ab1
No known key found for this signature in database
GPG key ID: 8F2F97D3BE8D7735

View file

@ -201,6 +201,7 @@ std::string ssoResponseTemplate = R"""(
</html> </html>
)"""; )""";
#if ZT_DEBUG==1
std::string dump_headers(const httplib::Headers &headers) { std::string dump_headers(const httplib::Headers &headers) {
std::string s; std::string s;
char buf[BUFSIZ]; char buf[BUFSIZ];
@ -250,6 +251,7 @@ std::string http_log(const httplib::Request &req, const httplib::Response &res)
return s; return s;
} }
#endif
// Configured networks // Configured networks
class NetworkState class NetworkState
@ -1975,9 +1977,11 @@ public:
_controlPlane.set_pre_routing_handler(authCheck); _controlPlane.set_pre_routing_handler(authCheck);
#if ZT_DEBUG==1
_controlPlane.set_logger([](const httplib::Request &req, const httplib::Response &res) { _controlPlane.set_logger([](const httplib::Request &req, const httplib::Response &res) {
fprintf(stderr, "%s", http_log(req, res).c_str()); fprintf(stderr, "%s", http_log(req, res).c_str());
}); });
#endif
_serverThread = std::thread([&] { _serverThread = std::thread([&] {
if (_primaryPort==0) { if (_primaryPort==0) {