Skip to content

Conversation

@jakemac53
Copy link
Contributor

No description provided.

@jakemac53 jakemac53 requested a review from grouma April 18, 2019 16:34
Copy link
Member

@grouma grouma left a comment

Choose a reason for hiding this comment

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

I'm surprised there are no test changes. They all work as expected?

@jakemac53
Copy link
Contributor Author

I'm surprised there are no test changes. They all work as expected?

I was just letting travis find the errors and ill fix them up - but there don't seem to be a lot, mostly logging related.

Copy link
Member

@grouma grouma left a comment

Choose a reason for hiding this comment

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

LGTM. Ping me when you have fixed the tests.

'directory.'));

await process.shouldExit(73);
await process.shouldExit(isNot(0));
Copy link
Member

Choose a reason for hiding this comment

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

Is this technically a breaking change?

Copy link
Member

Choose a reason for hiding this comment

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

This was potentially valuable, though I don't know if there were any actual users. Is it possible to still support it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can't reasonably support it as it stands right now I don't think, we don't get exit codes from the build daemon as far as I could tell.

@kevmoo
Copy link
Member

kevmoo commented Apr 18, 2019

Do we want to get this in for v2?

var log = serverLog.log;
Level recordLevel;
for (var level in Level.LEVELS) {
if (log.startsWith('[$level]')) {
Copy link
Member

Choose a reason for hiding this comment

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

We're going to end up building this string over and over. I wonder if we want something like:

final levelsByLabel = Map.fromIterable(Level.LEVELS, key: (l) => '[$l]'); // should be static

...
var messageLabel = levelsByLabel.keys.firstWhere(log.startsWith);
return messageLabel == null ? null : levelsByLabel[messageLabel];

Then we can look forward to writing it instead as

var levelsByLabel = {for (var l in Level.LEVELS) '[$l]': l};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just moved these utilities around in this pr since they aren't specific to the serve command any more, we could follow up with something but I think we have a lot of other much slower things going on in the logging than this :D.

Also probably a switch statement or something would probably be faster than a map for that if we are concerned about perf?

@jakemac53
Copy link
Contributor Author

Do we want to get this in for v2?

yes

@jakemac53 jakemac53 merged commit 73fa54f into master Apr 18, 2019
@jakemac53 jakemac53 deleted the build-daemon branch April 18, 2019 21:40
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

Successfully merging this pull request may close these issues.

4 participants