How to print debug message in the OpenBMC

1.3k Views Asked by At

I want to print debug message in the bmcweb of OpenBMC. The development language of OpenBMC is c++, and I print the message through printf and cout, but it does't work. In the console of qemu, I can not see any message I print ....

Any one could help me ? >__< Thank you very much!

2

There are 2 best solutions below

0
On

In the OpenBMC console, enter journalctl to show system log.

1
On

It works to use printf and look at the journalctl (journalctl -u bmcweb), for quick debugging. However, bmcweb does a have logging wrapper that would be better for long term code changes.

BMCWEB_LOG_ERROR << "UNIX socket: async_accept error = ";

Then make sure BMCWEB_ENABLE_LOGGING is set in the recipe build.