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

Clean up the writing of recording messages. #12

Open
kowalej opened this issue Dec 14, 2018 · 2 comments
Open

Clean up the writing of recording messages. #12

kowalej opened this issue Dec 14, 2018 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@kowalej
Copy link

kowalej commented Dec 14, 2018

Since some messages such as "Offsets thread is finished.", "Received header for stream ", etc, are being outputted from multiple threads, they show up looking a mess inside a console window, especially when one has multiple LSL streams running. Perhaps you can lock a new "output mutex" when doing calls to cout and cerr to make sure the messages look nice.

@tstenner tstenner added enhancement New feature or request good first issue Good for newcomers labels Dec 14, 2018
@tstenner
Copy link
Contributor

So far I haven't had that issue personally, but I mostly have less than 10 streams and maybe my libstdc++ is less prone to it than others.

My suggestion: create a logging function (void log(const std::string& msg)) that locks a mutex internally. That way we can also enable callbacks to a logging function later on more easily.
Is this something you'd be comfortable preparing a PR for?

@kowalej
Copy link
Author

kowalej commented Dec 14, 2018

Yep that's exactly what I was thinking. I can do a PR for it pretty soon. For reference this messy message issue was seen on multiple different Windows 10 machines in both CMD and PowerShell outputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants