Skip to content

Conversation

@devoncarew
Copy link
Contributor

  • have app loggers log to their parent logger (instead of directly to stdout). This does the right thing wrt the verbosity level (it respects -v)

@tvolkert

AppDomain domain;
final AppInstance app;
final bool logToStdout;
final Logger logToParent;
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe just parent?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

}
}

/// A [Logger] which sends log messages to a listening daemon client.
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't really understand this class. What is the logToParent option for? It seems to make the entire class just act like the provided parent, in which case, why bother creating the object at all?

Copy link
Contributor Author

@devoncarew devoncarew Jun 1, 2017

Choose a reason for hiding this comment

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

logToParent changes the behavior to use the parent to handle all stdout. This is valuable for IntelliJ's implementation of the flutter run -v option - previously we weren't passing trace level messages to the IDEs. An equivalent change would be to keep the current behavior - not add logToParent - but change to pass all message levels (including trace) to IDEs.

why bother creating the object at all?

With or without those changes, this class sends progress messages to the IDE, so it can use that info to provide nice, integrated progress UIs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to have two subclasses of _AppRunLogger, one for when you want to send all events to the IDE, and one for when you only want to send progress events to the IDE but want status, error, and trace events to instead be logged to the console?

I still don't really understand what this is for.

The actual change (from logToStdout to having an explicit parent) seems like an improvement, I'm just stuck on the underlying code that you're changing here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Re: two loggers, that's totally doable - and I do agree that the current state is a bit confusing.

The main value this class adds is letting IDEs convert the spinner progress info available in the CLI to progress mechanisms that make more sense in the IDE (indeterminate progress bars). And what I'm trying to do w/ this change is to plumb more of the verbose info through, so people can use the equivalent of flutter run -v to help diagnose when there are issues launching apps.

The actual change (from logToStdout to having an explicit parent) seems like an improvement

lgtm then, or should I work on specialized _AppRunLogger subclasses?

Copy link
Contributor

Choose a reason for hiding this comment

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

You should at a minimum leave a TODO mentioning that it might make sense to refactor this code.

<excludeFolder url="file://$MODULE_DIR$/test/runner/packages" />
<excludeFolder url="file://$MODULE_DIR$/test/src/packages" />
<excludeFolder url="file://$MODULE_DIR$/tool/packages" />
</content>
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these changes expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They were, so I'd have less scm churn here. Note that the not-yet-released version of IntelliJ won't generate these excludes, so there won't be as many changes to these files.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we do this in a separate PR maybe? I don't really understand why this particular file exists in our repo at all, but that's probably a discussion for another bug.

@Hixie
Copy link
Contributor

Hixie commented Jun 2, 2017

LGTM but @tvolkert is the right person to review this.

@devoncarew
Copy link
Contributor Author

Sounds good (and added a TODO).

@tvolkert
Copy link
Contributor

tvolkert commented Jun 2, 2017

LGTM modulo @Hixie's comment about flutter_tools.iml

@devoncarew
Copy link
Contributor Author

Sure, reverted the .iml file change.

@devoncarew devoncarew merged commit 15928fb into flutter:master Jun 2, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants