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

Log domain support and minor fixes #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

xanathar
Copy link

@xanathar xanathar commented Jun 23, 2020

Hi, I know it's a LOT of changes, but I think these will improve the library a lot (plus, they are backward compatible with the current implementation).

  • Adds support for the log domain and the possibility to create a custom logger
  • Domain can be either globally specified, inferred from context, or inferred from a G_LOG_DOMAIN static of the current module (using g_trace! ... gerror! macros, or redefined trace! ... error! macros hidden behind a feature, so not to clash with log ones unless intended).
  • Adds the possibility to create a simple logger which does not print file/line info
  • Serializes test execution to avoid race conditions which lead to random failures (this is caused by tests not being thread-safe because of glib_sys::g_log_set_default_handler calls which mutate global state)
  • Adds unit tests using the above macros and the classical log macros
  • Splits the content in several files for readability.
  • Adds examples for all the features
  • Adds cargo doc for all pub items

xanathar added 2 commits June 23, 2020 10:35
- Tests are not thread dependent anymore
- Added support for domain
- Added support for customized loggers
- Added support for simple loggers without file/line info
@xanathar xanathar marked this pull request as draft July 1, 2020 18:20
@xanathar
Copy link
Author

xanathar commented Jul 2, 2020

This is ready for review.

@xanathar xanathar marked this pull request as ready for review July 2, 2020 10:35
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

Successfully merging this pull request may close these issues.

1 participant