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

Fixed double output from global logger. #769

Merged
merged 4 commits into from
Apr 13, 2022
Merged

Conversation

ethangreen-dev
Copy link
Collaborator

A quick fix which resolves #761 via the following changes:

  • Added branch to ensure log handlers can't be installed multiple times. This is relevant in (rare) cases when gillespy2/core/__init__.py is evaluated more than once.
  • Set global logger name to root and set logger.propagate to False. This is the change which ensures that log writes only occur once.

- Added branch to ensure log handlers can't be installed twice.
- Set global logger name to `root` and disabled log propagation.
@ethangreen-dev ethangreen-dev added the bug Something isn't working label Apr 10, 2022
@ethangreen-dev ethangreen-dev self-assigned this Apr 10, 2022
@ethangreen-dev ethangreen-dev marked this pull request as draft April 10, 2022 09:17
@ethangreen-dev ethangreen-dev marked this pull request as ready for review April 10, 2022 17:44
@ethangreen-dev ethangreen-dev linked an issue Apr 10, 2022 that may be closed by this pull request
@BryanRumsey BryanRumsey added this to the 1.6.9 milestone Apr 11, 2022
Copy link
Contributor

@BryanRumsey BryanRumsey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double logging still occurs

results = model.run(show_labels=False)

2022-04-11 06:51:28,746 - root - WARNING - show_labels = False is deprecated. Future releases of GillesPy2 may not support this feature.
2022-04-11 06:51:28,746 - root - WARNING - show_labels = False is deprecated. Future releases of GillesPy2 may not support this feature.

@briandrawert
Copy link
Member

Double output seems to only occur on OSX environments.

@briandrawert briandrawert merged commit 4ad3432 into develop Apr 13, 2022
@briandrawert briandrawert deleted the fix/double-log branch April 13, 2022 19:45
@BryanRumsey BryanRumsey mentioned this pull request Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logging is displaying double log entries
3 participants