Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce consistent logging #40

Open
aleneum opened this issue Jul 3, 2019 · 2 comments
Open

Introduce consistent logging #40

aleneum opened this issue Jul 3, 2019 · 2 comments

Comments

@aleneum
Copy link
Member

aleneum commented Jul 3, 2019

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.

@guihomework
Copy link

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 ?

@aleneum
Copy link
Member Author

aleneum commented Jul 3, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants