Skip to content

[logging] Add logging to project initialization#8322

Merged
helin24 merged 2 commits into
flutter:masterfrom
helin24:initializer-log
Jul 11, 2025
Merged

[logging] Add logging to project initialization#8322
helin24 merged 2 commits into
flutter:masterfrom
helin24:initializer-log

Conversation

@helin24
Copy link
Copy Markdown
Member

@helin24 helin24 commented Jul 9, 2025

This logs any issues from project setup in FlutterInitializer to our dedicated log file.

The log variable from protected val log is internal, and I'm not sure why (despite asking Gemini multiple questions about it). That's why I'm accessing the log from a function instead.

@helin24 helin24 requested review from jwren and pq July 9, 2025 17:55
@helin24 helin24 merged commit a17f509 into flutter:master Jul 11, 2025
8 checks passed
@helin24 helin24 deleted the initializer-log branch July 11, 2025 17:18
}
}

protected fun log(): Logger {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Out of curiosity: why did you decide to use a function rather than just accessing the field directly?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Ah, hmmm. Just read your note above:

The log variable from protected val log is internal, and I'm not sure why (despite asking Gemini multiple questions about it). That's why I'm accessing the log from a function instead.

Seems odd. (Will investigate.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I tried, but for some reason it's "internal"? I couldn't figure out why. Gemini suggested this is because the logger class is declared internal at some point, but I couldn't find anything related to that in the source code. 🤷 ???

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are you overriding a log variable in ProjectActivity?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ProjectActivity is an interface that doesn't seem to have a log variable exposed, and FlutterProjectActivity doesn't label the log var as overridden

}

public static Logger createLogger(@NotNull Class<?> logClass) {
public static @NotNull Logger createLogger(@NotNull Class<?> logClass) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Cool!

@helin24 helin24 changed the title Add logging to project initialization [logging] Add logging to project initialization Jul 24, 2025
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.

3 participants