-
Notifications
You must be signed in to change notification settings - Fork 52
Conversation
Maybe opt-in, but defaulting here seems a bit too far. My $0.02 |
Hmm, yes, this is a core package, and I'd be concerned that |
@devoncarew in @bkonyi 's doc on Developer Tooling exploration, he points out that package:logging should at least have a default handler that forwards logs to Opt in could be a possibility for sure, but I think @bkonyi mentioned that he would prefer the dev logging by default. |
I don't think enabling this by default will result in much of a performance regression. For release mode applications, this Not using |
I'm also worried about enabling this by default.
What are the impacts of extra |
I'm very much in favor of making structured logging visible to developers and improving the support for logging in our libraries and developer tools. I think this meeds a bit more thought however than can be done in a few line PR. One possible design would be for dart:developer to have a way to register a logging provider. When in a log view of a developer tool - like devtools - the user could toggle on the 'package:logging' stream, which would then listen for all package:logging log events. This would be zero cost when logging wasn't being used. |
Thankfully for production (dart2js) this should be a noop - our patch for However, we had issues in the past with overhead from |
AFAIK @elliette discovered and fixed the problem we had with our |
Co-authored-by: Nate Bosch <nbosch1@gmail.com>
This is already the case for |
Although DDS does store a log history by default, which would cause this stream to be listened to immediately if the VM service is enabled. However, in situations where the VM service isn't enabled, there's no event created or sent. |
Some context on what happens for
The issue that was reported saying this wasn't working was because the DWDS change wasn't in the reporter's version of Flutter: dart-lang/webdev#2400 (comment) |
It sounds like we could benefit from some data on the approaches. I'll set out to test these to see what types of impacts there are. To ensure I understand the concerns involved though. I'd like to try to summarize the approaches to be tested and how to test them. Please let me know if the following seems to touch the points in contention App to test againstUse the CPU profiler to analyse the runtime of the following code in a flutter app (it would be run after clicking a button.) void _runLoggingtest() {
final defaultTag = getCurrentTag();
final logTestTag = UserTag('Log Test');
logTestTag.makeCurrent();
for (var i = 0; i < 1000000; i++) {
log.fine('Log test i: $i');
}
defaultTag.makeCurrent();
} Cases to test
States to test against
|
Note: I'll use |
Closing as the dart-lang/logging repository is merged into the dart-lang/core monorepo. Please re-open this PR there! |
As part of some product excellence pursuits for Dart Devtools we would like to make sure that package:logging records are also sent to Dart Devtools.
TBD i'm going to reach out to package members to ask about the best way to test this.