Skip to content
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

[Bug]: dart:developer logs are not showing up in the dev log #124

Open
Thesmader opened this issue Feb 2, 2022 · 5 comments
Open

[Bug]: dart:developer logs are not showing up in the dev log #124

Thesmader opened this issue Feb 2, 2022 · 5 comments

Comments

@Thesmader
Copy link
Collaborator

Thesmader commented Feb 2, 2022

Describe the bug
While running Flutter applications, logs using log() from dart:developer are not showing up in the dev log.

My configuration:

 require('flutter-tools').setup{
   dev_log = {
     enabled = true,
     open_cmd = "tabedit"
   },
   dev_tools = {
     autostart = true
   },
   --debugger = {
     --enabled = true,
     --run_via_dap = true,
     --register_configurations = function(_)
       --require("dap").configurations.dart = {}
       --require("dap.ext.vscode").load_launchjs()
    --end,
   --}
 }

The issue is there, whether or not the debugger is enabled or run_via_dap is set to true.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new flutter project(default counter app)
  2. Use the log() method from dart:developer to log something( maybe log the value of _counter in the _incrementCounter() method.

Expected behavior
The log should show up in the dev log.

System information

  • OS: Manjaro Linux
  • Flutter version: 2.8.1
  • Is flutter in $PATH: Yes
  • neovim version: v0.7.0-dev+994-g5be2cdd91

Additional context
According to #3653 on the Dart-Code repo these logs only work while debugging.

Thank you for this awesome plugin 😄

@Thesmader
Copy link
Collaborator Author

@akinsho Sorry to bug you. I understand that you might have a lot of things on your plate 😅 . May I get a little help here? I really want this to work if it's possible 😬

@akinsho
Copy link
Collaborator

akinsho commented Feb 21, 2022

@Thesmader unfortunately I can't be of much help, I definitely don't have the bandwidth to dig into this, and it's definitely not something I personally ever encounter since I don't use dart:developer logs.

Based on the issue you linked, seems that are intended to only be shown when the app is run in debug mode, so possible only whilst using something like run_with_dap. If they don't show up in the normal stdout of the flutter run command, then I can't do anything about that. If they are part of the logs whilst being run via dap then you could have a look at the dap_runner.lua file. There are specific events being listened too and appended to the log, and the dev logs might be an event within that.

I don't know which it is or really how the dap runner works since another user contributed it (🙏🏿 ).

@euler007
Copy link

@Thesmader did you figure this one out?

@Thesmader
Copy link
Collaborator Author

Hi @euler007 . I believe the dart developer logs are showing up atleast while developing on mobile. Haven't tried with web or other platforms.

@RyanCarrier
Copy link

Yeah without dap, the dev logs won't come up

Otherwise you can see them in devtools; in dev tools -> logging, you can apply a filter, iirc -k:flutter.frame to reduce the noise and get (mostly) just your logging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants