Skip to content

Conversation

@natebosch
Copy link
Member

Now that there is a split with some of these logger names coming from
build_runner_core it's not as easy to roll out changes which introduce
new logger names. The only cases where we do want to show the logger
name are the ones where we are running actions and will always fit the
pattern of '$builderLabel on $input'.

Now that there is a split with some of these logger names coming from
`build_runner_core` it's not as easy to roll out changes which introduce
new logger names. The only cases where we do want to show the logger
name are the ones where we are running actions and will always fit the
pattern of `'$builderLabel on $input'`.
@natebosch natebosch requested a review from jakemac53 April 17, 2019 22:49
@googlebot googlebot added the cla: yes Google is happy with the PR contributors label Apr 17, 2019
String _recordHeader(LogRecord record, bool verbose) {
var maybeSplit = record.level >= Level.WARNING ? '\n' : '';
return verbose || !knownNames.contains(record.loggerName)
return verbose || record.loggerName.contains(' on ')
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a big fan of the pattern matching here... if we instead removed all the custom loggers and used a single common logger we could check for that one specifically and it would be a fair bit better I think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh although then we wouldn't get the names in verbose mode...

Copy link
Contributor

Choose a reason for hiding this comment

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

Another option could be creating a custom LogRecord type? That would be safer but also has other disadvantages, although that class hasn't changed in ages so it is unlikely we would run into issues.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd be in favor of dropping the names in verbose mode and simplifying down to a single common logger, but they can be handy sometimes so I can see an argument for keeping them.

I'm not excited by the idea of a custom LogRecord implementation, though I think all the cases for logs that we do want to print the name go through BuildForInputLogger which might give us some leverage to handle it...

Copy link
Member Author

Choose a reason for hiding this comment

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

dart-lang/webdev#305 added a dependency on the only logger names we want printed containing a space. I'll use the same criteria here.

In the long term we'll likely want to prefix all the non-shown logger names with build.

Copy link
Contributor

Choose a reason for hiding this comment

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

In the long term we'll likely want to prefix all the non-shown logger names with build.

Although now that I think about it this would break for webdev haha

grouma added a commit to dart-lang/webdev that referenced this pull request Apr 22, 2019
This assumes the logger names do not contain spaces. Based off of dart-lang/build#2194 this assumption appears correct.

Closes #301
@natebosch natebosch merged commit 0b40482 into master Apr 22, 2019
@natebosch natebosch deleted the drop-known-names branch April 22, 2019 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Google is happy with the PR contributors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants