Skip to content

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

Open
mlinden4 wants to merge 1 commit intoJoeOsborn:mainfrom
mlinden4:main
Open

Added the ability to initialize a custom logging procedure using Driver's new_with_logging#1
mlinden4 wants to merge 1 commit intoJoeOsborn:mainfrom
mlinden4:main

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