Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit 4d3e8da

Browse files
Add logging control for Yml parser
1 parent 38c8de4 commit 4d3e8da

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

aic-emu/YmlParser.cc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@
1919

2020
#include "CmdHandler.h"
2121

22+
static bool g_logEnable = true;
23+
2224
int GetEventCode(std::string str)
2325
{
24-
std::cout << str << "@@@@@@@@@" << std::endl;
26+
if (g_logEnable)
27+
std::cout << str << "@@@@@@@@@" << std::endl;
28+
2529
int event = 0;
2630

2731
if (str == "VHAL_DD_EVENT_DISPINFO_REQ")
@@ -52,6 +56,16 @@ int GetEventCode(std::string str)
5256
return event;
5357
}
5458

59+
void YAML::SetParserLogFlag(bool value)
60+
{
61+
g_logEnable = value;
62+
}
63+
64+
bool YAML::GetParserLogFlag()
65+
{
66+
return g_logEnable;
67+
}
68+
5569
bool YAML::convert<AicEventMetadataPtr>::decode(const YAML::Node& node, AicEventMetadataPtr &mptr)
5670
{
5771
if (mptr == nullptr || !node.IsMap())

aic-emu/YmlParser.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,9 @@ namespace YAML
9191
template <> struct convert<DisplayCtrlPtr> {
9292
static bool decode(const Node& node, DisplayCtrlPtr &mptr);
9393
};
94+
95+
bool GetParserLogFlag();
96+
97+
void SetParserLogFlag(bool value);
9498
}
9599
#endif

0 commit comments

Comments
 (0)