12
12
#include < map>
13
13
#include < optional>
14
14
15
- PHOSPHOR_LOG2_USING;
16
-
17
15
namespace pldmtool
18
16
{
19
17
@@ -75,8 +73,8 @@ class GetDateTime : public CommandInterface
75
73
&month, &year);
76
74
if (rc != PLDM_SUCCESS || cc != PLDM_SUCCESS)
77
75
{
78
- error (" Response Message Error: rc = {KEY0}, cc={KEY1}" , " KEY0" , rc ,
79
- " KEY1" , (int )cc);
76
+ lg2:: error (" Response Message Error: rc = {KEY0}, cc={KEY1}" , " KEY0" ,
77
+ rc, " KEY1" , (int )cc);
80
78
return ;
81
79
}
82
80
@@ -133,7 +131,7 @@ class SetDateTime : public CommandInterface
133
131
if (!uintToDate (tmData, &year, &month, &day, &hours, &minutes,
134
132
&seconds))
135
133
{
136
- error (" decode date Error: tmData={KEY0}" , " KEY0" , tmData);
134
+ lg2:: error (" decode date Error: tmData={KEY0}" , " KEY0" , tmData);
137
135
138
136
return {PLDM_ERROR_INVALID_DATA, requestMsg};
139
137
}
@@ -153,8 +151,8 @@ class SetDateTime : public CommandInterface
153
151
154
152
if (rc != PLDM_SUCCESS || completionCode != PLDM_SUCCESS)
155
153
{
156
- error (" Response Message Error: rc = {KEY0}, cc={KEY1}" , " KEY0" , rc ,
157
- " KEY1" , (int )completionCode);
154
+ lg2:: error (" Response Message Error: rc = {KEY0}, cc={KEY1}" , " KEY0" ,
155
+ rc, " KEY1" , (int )completionCode);
158
156
159
157
return ;
160
158
}
@@ -212,15 +210,16 @@ class GetBIOSTableHandler : public CommandInterface
212
210
tableType, request);
213
211
if (rc != PLDM_SUCCESS)
214
212
{
215
- error (" Encode GetBIOSTable Error, tableType= {KEY0}, rc = {KEY1}" ,
216
- " KEY0" , pldmBIOSTableMap.at (tableType), " KEY1" , rc);
213
+ lg2::error (
214
+ " Encode GetBIOSTable Error, tableType= {KEY0}, rc = {KEY1}" ,
215
+ " KEY0" , pldmBIOSTableMap.at (tableType), " KEY1" , rc);
217
216
return std::nullopt;
218
217
}
219
218
std::vector<uint8_t > responseMsg;
220
219
rc = pldmSendRecv (requestMsg, responseMsg);
221
220
if (rc != PLDM_SUCCESS)
222
221
{
223
- error (" PLDM: Communication Error, rc ={KEY0}" , " KEY0" , rc);
222
+ lg2:: error (" PLDM: Communication Error, rc ={KEY0}" , " KEY0" , rc);
224
223
return std::nullopt;
225
224
}
226
225
@@ -237,7 +236,7 @@ class GetBIOSTableHandler : public CommandInterface
237
236
238
237
if (rc != PLDM_SUCCESS || cc != PLDM_SUCCESS)
239
238
{
240
- error (
239
+ lg2:: error (
241
240
" GetBIOSTable Response Error: tableType={KEY0}, rc ={KEY1}, cc={KEY2}" ,
242
241
" KEY0" , pldmBIOSTableMap.at (tableType), " KEY1" , rc, " KEY2" ,
243
242
(int )cc);
@@ -379,7 +378,7 @@ class GetBIOSTableHandler : public CommandInterface
379
378
}
380
379
else
381
380
{
382
- info (" Get AttributeType failed." );
381
+ lg2:: info (" Get AttributeType failed." );
383
382
}
384
383
}
385
384
switch (attrType)
@@ -454,7 +453,7 @@ class GetBIOSTableHandler : public CommandInterface
454
453
case PLDM_BIOS_PASSWORD:
455
454
case PLDM_BIOS_PASSWORD_READ_ONLY:
456
455
{
457
- info (" Password attribute: Not Supported" );
456
+ lg2:: info (" Password attribute: Not Supported" );
458
457
break ;
459
458
}
460
459
}
@@ -519,7 +518,7 @@ class GetBIOSTable : public GetBIOSTableHandler
519
518
{
520
519
if (!stringTable)
521
520
{
522
- error (" GetBIOSStringTable Error" );
521
+ lg2:: error (" GetBIOSStringTable Error" );
523
522
return ;
524
523
}
525
524
ordered_json stringdata;
@@ -539,7 +538,7 @@ class GetBIOSTable : public GetBIOSTableHandler
539
538
{
540
539
if (!stringTable)
541
540
{
542
- error (" GetBIOSAttributeTable Error" );
541
+ lg2:: error (" GetBIOSAttributeTable Error" );
543
542
return ;
544
543
}
545
544
ordered_json output;
@@ -565,7 +564,7 @@ class GetBIOSTable : public GetBIOSTableHandler
565
564
}
566
565
else
567
566
{
568
- error (" Get AttributeType failed." );
567
+ lg2:: error (" Get AttributeType failed." );
569
568
}
570
569
571
570
switch (attrType)
@@ -658,7 +657,7 @@ class GetBIOSTable : public GetBIOSTableHandler
658
657
}
659
658
case PLDM_BIOS_PASSWORD:
660
659
case PLDM_BIOS_PASSWORD_READ_ONLY:
661
- alert (" Password attribute: Not Supported" );
660
+ lg2:: alert (" Password attribute: Not Supported" );
662
661
}
663
662
output.emplace_back (std::move (attrdata));
664
663
}
@@ -670,7 +669,7 @@ class GetBIOSTable : public GetBIOSTableHandler
670
669
{
671
670
if (!attrValTable)
672
671
{
673
- error (" GetBIOSAttributeValueTable Error" );
672
+ lg2:: error (" GetBIOSAttributeValueTable Error" );
674
673
return ;
675
674
}
676
675
ordered_json output;
@@ -715,14 +714,14 @@ class GetBIOSAttributeCurrentValueByHandle : public GetBIOSTableHandler
715
714
716
715
if (!stringTable || !attrTable)
717
716
{
718
- info (" StringTable/AttrTable Unavaliable" );
717
+ lg2:: info (" StringTable/AttrTable Unavaliable" );
719
718
return ;
720
719
}
721
720
722
721
auto handle = findAttrHandleByName (attrName, *attrTable, *stringTable);
723
722
if (!handle)
724
723
{
725
- error (" Could not find the attribute {KEY0}" , " KEY0" , attrName);
724
+ lg2:: error (" Can not find the attribute {KEY0}" , " KEY0" , attrName);
726
725
return ;
727
726
}
728
727
@@ -735,15 +734,15 @@ class GetBIOSAttributeCurrentValueByHandle : public GetBIOSTableHandler
735
734
instanceId, 0 , PLDM_GET_FIRSTPART, *handle, request);
736
735
if (rc != PLDM_SUCCESS)
737
736
{
738
- error (" PLDM: Request Message Error, rc ={KEY0}" , " KEY0" , rc);
737
+ lg2:: error (" PLDM: Request Message Error, rc ={KEY0}" , " KEY0" , rc);
739
738
return ;
740
739
}
741
740
742
741
std::vector<uint8_t > responseMsg;
743
742
rc = pldmSendRecv (requestMsg, responseMsg);
744
743
if (rc != PLDM_SUCCESS)
745
744
{
746
- error (" PLDM: Communication Error, rc ={KEY0}" , " KEY0" , rc);
745
+ lg2:: error (" PLDM: Communication Error, rc ={KEY0}" , " KEY0" , rc);
747
746
return ;
748
747
}
749
748
@@ -759,8 +758,8 @@ class GetBIOSAttributeCurrentValueByHandle : public GetBIOSTableHandler
759
758
&attributeData);
760
759
if (rc != PLDM_SUCCESS || cc != PLDM_SUCCESS)
761
760
{
762
- error (" Response Message Error: rc = {KEY0}, cc={KEY1}" , " KEY0" , rc ,
763
- " KEY1" , (int )cc);
761
+ lg2:: error (" Response Message Error: rc = {KEY0}, cc={KEY1}" , " KEY0" ,
762
+ rc, " KEY1" , (int )cc);
764
763
765
764
return ;
766
765
}
@@ -810,15 +809,15 @@ class SetBIOSAttributeCurrentValue : public GetBIOSTableHandler
810
809
811
810
if (!stringTable || !attrTable)
812
811
{
813
- info (" StringTable/AttrTable Unavaliable" );
812
+ lg2:: info (" StringTable/AttrTable Unavaliable" );
814
813
return ;
815
814
}
816
815
817
816
auto attrEntry = findAttrEntryByName (attrName, *attrTable,
818
817
*stringTable);
819
818
if (attrEntry == nullptr )
820
819
{
821
- info (" Could not find attribute :{KEY0}" , " KEY0" , attrName);
820
+ lg2:: info (" Could not find attribute :{KEY0}" , " KEY0" , attrName);
822
821
return ;
823
822
}
824
823
@@ -849,7 +848,7 @@ class SetBIOSAttributeCurrentValue : public GetBIOSTableHandler
849
848
attrValue.c_str ());
850
849
if (stringEntry == nullptr )
851
850
{
852
- info (" Set Attribute Error: It's not a possible value" );
851
+ lg2:: info (" Set Attribute Error: It's not a possible value" );
853
852
854
853
return ;
855
854
}
@@ -864,7 +863,7 @@ class SetBIOSAttributeCurrentValue : public GetBIOSTableHandler
864
863
}
865
864
if (i == pvNum)
866
865
{
867
- info (" Set Attribute Error: It's not a possible value" );
866
+ lg2:: info (" Set Attribute Error: It's not a possible value" );
868
867
return ;
869
868
}
870
869
@@ -935,14 +934,14 @@ class SetBIOSAttributeCurrentValue : public GetBIOSTableHandler
935
934
936
935
if (rc != PLDM_SUCCESS)
937
936
{
938
- error (" PLDM: Request Message Error, rc ={KEY0}" , " KEY0" , rc);
937
+ lg2:: error (" PLDM: Request Message Error, rc ={KEY0}" , " KEY0" , rc);
939
938
return ;
940
939
}
941
940
std::vector<uint8_t > responseMsg;
942
941
rc = pldmSendRecv (requestMsg, responseMsg);
943
942
if (rc != PLDM_SUCCESS)
944
943
{
945
- error (" PLDM: Communication Error, rc ={KEY0}" , " KEY0" , rc);
944
+ lg2:: error (" PLDM: Communication Error, rc ={KEY0}" , " KEY0" , rc);
946
945
return ;
947
946
}
948
947
uint8_t cc = 0 ;
@@ -955,8 +954,8 @@ class SetBIOSAttributeCurrentValue : public GetBIOSTableHandler
955
954
responsePtr, payloadLength, &cc, &nextTransferHandle);
956
955
if (rc != PLDM_SUCCESS || cc != PLDM_SUCCESS)
957
956
{
958
- error (" Response Message Error: rc = {KEY0}, cc={KEY1}" , " KEY0" , rc ,
959
- " KEY1" , (int )cc);
957
+ lg2:: error (" Response Message Error: rc = {KEY0}, cc={KEY1}" , " KEY0" ,
958
+ rc, " KEY1" , (int )cc);
960
959
return ;
961
960
}
962
961
0 commit comments