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

Logger is in global namespace #210

Open
raub opened this issue Nov 18, 2023 · 2 comments
Open

Logger is in global namespace #210

raub opened this issue Nov 18, 2023 · 2 comments

Comments

@raub
Copy link
Contributor

raub commented Nov 18, 2023

The LabSound logger API is not contained in lab:: - so it may conflict with whichever other logger having a log_set_level function, or some others.

PS. I was able to do log_set_level(LOGLEVEL_WARN); in my project, but shouldn't it be the default?

@meshula
Copy link
Member

meshula commented Nov 18, 2023

That logging library is meant for C, so probably it should be moved to cpp, with a namespace as you suggest. Also, it relies on zero initialization of the L struct, which should yield a default log level of TRACE, but I agree with you that WARN is a reasonable default.

@raub
Copy link
Contributor Author

raub commented Nov 19, 2023

Otherwise, you could mention changing the log-level in the doc as a normal step of library initialization.

If that's for C, a prefix would be fine too. Zero-init would still work if some of the enum members go negative.

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