]> git.proxmox.com Git - mirror_edk2.git/blob - RedfishPkg/Include/Library/RedfishDebugLib.h
RedfishPkg/RedfishDebugLib: provide Redfish debug
[mirror_edk2.git] / RedfishPkg / Include / Library / RedfishDebugLib.h
1 /** @file
2 This file defines the Redfish debug library interface.
3
4 Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #ifndef REDFISH_DEBUG_LIB_H_
11 #define REDFISH_DEBUG_LIB_H_
12
13 #include <Uefi.h>
14 #include <Library/JsonLib.h>
15 #include <Library/RedfishLib.h>
16
17 #define DEBUG_REDFISH_NETWORK DEBUG_INFO ///< Debug error level for Redfish networking function
18
19 /**
20
21 This function dump the Json string in given error level.
22
23 @param[in] ErrorLevel DEBUG macro error level
24 @param[in] JsonValue Json value to dump.
25
26 @retval EFI_SUCCESS Json string is printed.
27 @retval Others Errors occur.
28
29 **/
30 EFI_STATUS
31 DumpJsonValue (
32 IN UINTN ErrorLevel,
33 IN EDKII_JSON_VALUE JsonValue
34 );
35
36 /**
37
38 This function dump the status code, header and body in given
39 Redfish payload.
40
41 @param[in] ErrorLevel DEBUG macro error level
42 @param[in] Payload Redfish payload to dump
43
44 @retval EFI_SUCCESS Redfish payload is printed.
45 @retval Others Errors occur.
46
47 **/
48 EFI_STATUS
49 DumpRedfishPayload (
50 IN UINTN ErrorLevel,
51 IN REDFISH_PAYLOAD Payload
52 );
53
54 /**
55
56 This function dump the status code, header and body in given
57 Redfish response.
58
59 @param[in] Message Message string
60 @param[in] ErrorLevel DEBUG macro error level
61 @param[in] Response Redfish response to dump
62
63 @retval EFI_SUCCESS Redfish response is printed.
64 @retval Others Errors occur.
65
66 **/
67 EFI_STATUS
68 DumpRedfishResponse (
69 IN CONST CHAR8 *Message,
70 IN UINTN ErrorLevel,
71 IN REDFISH_RESPONSE *Response
72 );
73
74 /**
75
76 This function dump the HTTP status code.
77
78 @param[in] ErrorLevel DEBUG macro error level
79 @param[in] HttpStatusCode HTTP status code
80
81 @retval EFI_SUCCESS HTTP status code is printed
82
83 **/
84 EFI_STATUS
85 DumpHttpStatusCode (
86 IN UINTN ErrorLevel,
87 IN EFI_HTTP_STATUS_CODE HttpStatusCode
88 );
89
90 #endif