-
Notifications
You must be signed in to change notification settings - Fork 83
Detect whether the Debug Extension was built for dev or release #1800
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
Conversation
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.
LGTM with comments.
_newKeyValue( | ||
oldLine: line, | ||
newKey: 'name', | ||
newValue: '[DEV] MV3 Dart Debug Extension', |
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.
Thanks! That is really helpful to distinguish them from each other!
String msg, { | ||
String? prefix, | ||
bool devOnly = true, | ||
}) { | ||
_log(msg, prefix: prefix); |
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.
needs to pass devOnly
to _log
?
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.
Ah good catch!
String msg, { | ||
String? prefix, | ||
bool devOnly = true, | ||
}) { | ||
_log(msg, prefix: prefix, level: _LogLevel.warn); |
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.
same as above
debugError( | ||
String msg, { | ||
String? prefix, | ||
bool devOnly = 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.
same as above
_LogLevel? level, | ||
String? prefix, | ||
}) { | ||
if (devOnly && !isDevMode()) return; |
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.
Would it be reasonable to rename devOnly
to verbose
and maybe flip the default to 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.
Sg, switched to verbose!
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.
LGTM!
Detects whether the Debug Extension was built for dev or release.
In dev mode:
This PR also moves the
console.log
implementation intologger
and makes it private, so that the only way to log to the console is with thedebugLog
utilities.