iclcv/icl

Introduce consistent logging

Opened this issue · 2 comments

As #38 has shown, bug hunting is currently very tedious as many "logging output" just prints to standard out. Instead of extending the printed messages with function details, we should use proper logging whenever possible.

agreed, I did not want to go that deep for my debugging of CL issues, and thought why not add my few improved debug printouts in a commit. Proper logging (to a text file I suppose), would flood the logs for quite some apps we have here, as they extensively display everything they do. Probably a new ERROR macro should be used for logging errors, and leave the standard SHOW out of the log ? the same as distinguishing std::cout and std::cerr ?

I did not want to go that deep for my debugging of CL issues, and thought why not add my few improved debug printouts in a commit

It's painful to see that you actually had to do this (as in why hasnt that been more convenient from the start). There are many ways to add the origin/time to add a log message automatically. The ICL defines some LOG macros (ERROR_LOG, FUNCTION_LOG) which should be used instead of dumping output to std::cout. Currently, these macros more or less also just dump messages to std::cout but they wrap the messages at least.

Proper logging (to a text file I suppose), would flood the logs for quite some apps we have here

not necessarily. With log levels and pipes you can define what logging output should appear where.
Of course some output should be visible on std::cout and std::err but it should always be clear where it comes from. We could check whether Boost.Log or spdlog offers what we need.