1 // Copyright 2022 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef QUICHE_COMMON_QUICHE_CRYPTO_LOGGING_H_ 6 #define QUICHE_COMMON_QUICHE_CRYPTO_LOGGING_H_ 7 8 #include "absl/status/status.h" 9 10 namespace quiche { 11 12 // In debug builds only, log OpenSSL error stack. Then clear OpenSSL error 13 // stack. 14 void DLogOpenSslErrors(); 15 16 // Clears OpenSSL error stack. 17 void ClearOpenSslErrors(); 18 19 // Include OpenSSL error stack in Status msg so that callers could choose to 20 // only log it in debug builds if required. 21 absl::Status SslErrorAsStatus( 22 absl::string_view msg, absl::StatusCode code = absl::StatusCode::kInternal); 23 24 } // namespace quiche 25 26 #endif // QUICHE_COMMON_QUICHE_CRYPTO_LOGGING_H_ 27