Minres / SystemC-Components

A SystemC productivity library: https://minres.github.io/SystemC-Components/
https://www.minres.com/#opensource
Apache License 2.0
81 stars 21 forks source link

Corrected logging macros #38

Closed mbreiling closed 1 year ago

mbreiling commented 1 year ago

Corrected the macros SCCINFO .. SCCTRACEALL. There was a problem with them in structures like if (something) SCCINFO() << whatever; else other stuff

because the if inside the macro was paired to the else in this structure and produced erroneous behaviour.

eyck commented 1 year ago

THX for our contribution. But this introduces a performance sisue as all stream based formatting is being executed not matter if the result is printed or not. This is exactly what is being prevented by actual implementation.

The correct solutiion to your problem should be

if (something) {
    SCCINFO() << whatever;
} else
    other stuff