-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
[go_router] Execute log method when hierarchicalLoggingEnabled
is true regardless of debugLogDiagnostics
value
#139667
Comments
Thanks for the report @ycherniavskyi |
@darshankawar, my issue differs. From what I understand, setting Specifically, my concern aligns with flutter/packages#4875, which is due to the introduction of this condition. This condition effectively disables all logger calls regardless of the logging mode, which is controlled by the |
Thanks for the feedback. Seeing the same result as reported. stable, master flutter doctor -v
|
Is there a workaround? |
Wouldn't it be weird to have logs even though Maybe it would be better to modify And change it to void setLogging({bool enabled = false}) {
_subscription?.cancel();
_enabled = enabled;
- if (!enabled) {
+ if (!enabled || hierarchicalLoggingEnabled) {
return;
}
_subscription = logger.onRecord.listen((LogRecord e) { At least, it wouldn't log anything when |
@ValentinVignal, I completely agree with your suggestion – it's definitely clearer than what I had proposed. |
Fixes flutter/flutter#139667 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
…ter#6019) Fixes flutter/flutter#139667 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
Is there an existing issue for this?
Steps to reproduce
go_router
version >=11.1.2.hierarchicalLoggingEnabled
totrue
in themain
function of the projectonRecord
stream ofLogger('GoRouter')
Before flutter/packages#4875 everything works as described in expected resiles.
Expected results
Get event from
onRecord
stream ofLogger('GoRouter')
ifhierarchicalLoggingEnabled
istrue
regardless ofdebugLogDiagnostics
value.Because, if I understand it right, then if
hierarchicalLoggingEnabled
istrue
it means that you must have to control the whole logging logic from one place - thelogging
package, without interaction with each package that outputs logs separately.Actual results
If
debugLogDiagnostics
isfalse
then no events fromonRecord
stream ofLogger('GoRouter')
are received at all.But if
debugLogDiagnostics
istrue
then events fromonRecord
stream ofLogger('GoRouter')
are received but they doubled in the console with defaultdeveloper.log
executed bygo_router
.Get event from
onRecord
stream ofLogger('GoRouter')
regardless ofdebugLogDiagnostics
value.Proposed fix
To achieve the expected results the following condition must be extended.
From
To:
The text was updated successfully, but these errors were encountered: