xref: /aosp_15_r20/external/cronet/net/third_party/quiche/src/quiche/common/quiche_crypto_logging.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
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