Skip to content

Conversation

@devoncarew
Copy link
Contributor

This PR shows service protocol 'Logging' events in the run and debug consoles. I bumped the vm service protocol library classes for this - done as a separate commit for easier reviewability.

There's a small bit of code in here related to 'Flutter.Error' events; it's all disabled behind a compile time flag however.

Screen Shot 2019-06-26 at 2 11 59 PM

@devoncarew
Copy link
Contributor Author

cc @DanTup for the code related to listening for and displaying service protocol Logging events

@devoncarew devoncarew requested review from jacob314 and pq June 27, 2019 12:57
Copy link
Collaborator

@pq pq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like there are a bunch of timeline VM service-related changes in here too. Not sure if that's intentional?

public void clearVMTimeline(SuccessConsumer consumer) {
final JsonObject params = new JsonObject();
request("_clearVMTimeline", params, consumer);
request("clearVMTimeline", params, consumer);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deferring to @kenzieschmoll on these protocol changes...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These calls aren't used by the Flutter IntelliJ client, so should be no-ops in terms of the change.

* @param gc This parameter is optional and may be null.
* The [getAllocationProfile] RPC is used to retrieve allocation information for a given isolate.
* @param reset This parameter is optional and may be null.
* @param gc This parameter is optional and may be null.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside (and maybe for another time): consider annotation these @Nullable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This library is generated by another tool (https://github.com/dart-lang/vm_service_drivers) - it would be tricky to reference org.jetbrains.annotations classes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, to follow up on this, I think that IntelliJ's NNBD code also works with the javax.annotation.Nullable / javax.annotation.Notnull annotations, so we can add NNBD metadata to these calls. Definitely worth looking into.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dart-archive/vm_service_drivers#250, thought I don't know if its something we should land

Copy link
Collaborator

@pq pq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logging bits look great! 🔥

@@ -0,0 +1,84 @@
/*
* Copyright (c) 2015, the Dart project authors.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this (and others) are newly generated, consider updating copyright date?

import com.google.gson.JsonObject;

/**
* An {@link MemoryUsage} object provides heap usage information for a specific isolate at a given
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An => A

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done (on the next roll of this library; https://dart-review.googlesource.com/c/sdk/+/107800)

@devoncarew
Copy link
Contributor Author

It looks like there are a bunch of timeline VM service-related changes in here too. Not sure if that's intentional?

Yup; done as a separate commit from the other changes to make the review easier (which I should have mentioned in the first comment). The lib changes bring in a public API to work with the Logging code.

@devoncarew devoncarew merged commit 6b3516c into flutter:master Jul 2, 2019
alexander-doroshko pushed a commit to alexander-doroshko/flutter-intellij that referenced this pull request Jan 24, 2020
* upgrade the vm service library

* show service protocol logging events in the console view
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

show 'Logging' events in the regular Run/Debug console

3 participants