MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.CPP / callback

Method callback

src/loggers/bt_cout_logger.cpp:10–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8StdCoutLogger::~StdCoutLogger() = default;
9
10void StdCoutLogger::callback(Duration timestamp, const TreeNode& node,
11 NodeStatus prev_status, NodeStatus status)
12{
13 using namespace std::chrono;
14
15 constexpr const char* whitespaces = " ";
16 constexpr const size_t ws_count = 25;
17
18 const double since_epoch = duration<double>(timestamp).count();
19 printf("[%.3f]: %s%s %s -> %s", since_epoch, node.name().c_str(),
20 &whitespaces[std::min(ws_count, node.name().size())],
21 toStr(prev_status, true).c_str(), toStr(status, true).c_str());
22 std::cout << std::endl;
23}
24
25void StdCoutLogger::flush()
26{

Callers

nothing calls this directly

Calls 3

toStrFunction · 0.50
nameMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected