You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hierarchicalLoggingEnabled, recordStackTraceAtLevel, _rootLevel (and also the _loggers static field) are all global which makes testing code that uses global loggers difficult.
A solution could be to use expandos that are keyed to a zone environment variable for the 'global' logging state. This would make it easy to decouple tests.
The text was updated successfully, but these errors were encountered:
I worry that making these variables, which are already confusing and hard to reason about, zone level concepts we are just making things harder for ourselves.
If anything I think we should consider an entire overhaul of the API which doesn't suffer from these global impacts. Within that design we should certainly consider whether having some sort of zone scoped log variable would be useful - that's what we do in package:build and it has been working well for us. https://pub.dev/documentation/build/latest/build/log.html
Closing for now since I don't think we plan on addressing this with the current design.
hierarchicalLoggingEnabled
,recordStackTraceAtLevel
,_rootLevel
(and also the_loggers
static field) are all global which makes testing code that uses global loggers difficult.A solution could be to use expandos that are keyed to a zone environment variable for the 'global' logging state. This would make it easy to decouple tests.
The text was updated successfully, but these errors were encountered: