Skip to contentSkip to conversation

Using __func__ and __LINE__ in debug outputs

U-Boot Graeme Russ 1 participant 1 message Jan 23, 2015

lore
Share & tools
lore
#0 lore raw

Hi All,

What is the general consensus on using __func__ and __LINE__ in debug outputs?

My personal opinion is that distinct statements that can be grep'd are better for a couple of reasons:
- It keeps the debug statements shorter
- If your running a slightly older version of U-Boot, the line numbers
(and possibly even the function names) may not match the current version of the source code

Regardless of whether we should use __func__ and __LINE__, greping for __func__ yields 1,837 hits with inconsistent usage. Should we not simply have a #define which tells debug() to output the function and line number in a consistent manner?

Regards,

Graeme