-
Notifications
You must be signed in to change notification settings - Fork 210
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
Add a --fail-on-severe
flag, but keep it as false
#781
Conversation
onLog ??= stdIOLogListener; | ||
logListener = Logger.root.onRecord.listen((r) { | ||
if (r.level == Level.SEVERE) { | ||
severeLogHandled = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we ever reset this (for watch mode)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And again in watch_impl.dart
.
It might be better to fail the whole build early for this case, although doing so is a bit... tricky so this is probably safer. |
Yeah I thought about that, but we don't have a great lifecycle right now. If we can refactor to have a more clear |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine as is - we can always improve it later if needed.
@@ -31,10 +33,14 @@ class BuildOptions { | |||
// For testing only, skips the build script updates check. | |||
bool skipBuildScriptCheck; | |||
|
|||
// For internal use only, flipped when a severe log occurred. | |||
bool severeLogHandled = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This runs counter to the goal in #95 and makes me a little nervous.
Any particular reason we are using this rather than throwing at the point of the log call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can (and should) move the boolean to the BuildImpl class to remove the addition of dynamic state to BuildOptions.
The logs are coming from a stream so unless that becomes synchronous failing in the listener is sketchy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want me to revert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with the change for now. We can revisit in the linked issue.
Work towards #215.
We can flip this to
true
after better testing/validation this is a good idea.I purposefully didn't update the CHANGELOG/pubspec yet, will do before I merge.