Closed perrygoy closed 1 year ago
@bandophahita brought up a good point that maybe it would be useful for someone to be able to have different logs for different extensions, like logging ScreenPy Requests output to a separate file/adapter than ScreenPy Selenium. We currently have pacing
kind of assuming there's only one Narrator, though, so we'd need to do some decoupling work and some other changes to make that happen correctly.
For now, we think making Narrator a singleton to address the confusion is a good step, and we'll revisit this if we find a solid use case that we can build towards.
After some discussion, we decided not to go with this approach.
It's a little bit surprising, and we have no reason to believe there are folks out there instantiating their own Narrator
s using the class directly. Instead, we'll push the_narrator
as the thing to interact with.
When we originally created the
Narrator
class, we kind of thought that it might be useful to create multiple narrators if you needed to log to multiple places. Later we developed theAdapter
system and it's super freakin' cool, but also kind of negates the need to have multipleNarrator
s.With @bandophahita's work on allowing almost everything to be importable directly
from screenpy
, i had a concern that folks might accidentally importNarrator
when they should be importingthe_narrator
. MakingNarrator
a singleton will solve that problem!