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

Added the ability to initialize a custom logging procedure using Driver's new_with_logging #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mlinden4
Copy link

I changed the events.rs file to add the Logger trait and added a field to Driver to remember which logger to initialize. If you don't want the field in Driver, you could move the logging initialization to Driver::new()/new_with_logging(). I also had to change a line in engine_simple because it initializes the logging outside of the Driver and had to be changed to support the default EnvLogger.

@JoeOsborn
Copy link
Owner

Thanks! I wonder if the dynamic dispatch could be avoided with something like: struct Driver<L:Logger=EnvLogger>{ logger:L, ... }. I don't think it's bad for there to be a logger field, it's easy to imagine a logger that needs some global configuration.

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.

2 participants