[logging] Add a separate file for plugin logs#8253
Conversation
|
At the moment, this is the output in |
| @@ -1,5 +1,6 @@ | |||
| <component name="ProjectRunConfigurationManager"> | |||
| <configuration default="false" name="flutter-intellij [runIde]" type="GradleRunConfiguration" factoryName="Gradle"> | |||
| <log_file alias="flutter" path="$PROJECT_DIR$/build/idea-sandbox/AI-AI-251.23774.16.2511.13338727/log/flutter.log" /> | |||
There was a problem hiding this comment.
Should this be checked in? Will it be the same for everyone? Or is this specific to the build you have on your machine?
There was a problem hiding this comment.
Oops I missed this comment. I don't know what to do about this - this may be the same on all of our machines, but it looks like a very specific version of Android Studio. I guess this would update depending on what version we're building based on the product matrix?
| catch (IOException e) { | ||
| throw new RuntimeException(e); | ||
| } | ||
| System.setProperty("java.util.logging.SimpleFormatter.format", |
There was a problem hiding this comment.
Odd that you can't set format properties programmatically. (I see you can use a logging properties file but that's no better.)
Anyway: odd!
There was a problem hiding this comment.
I agree, super weird. It could be we'll find a better way to do this but I did not when I was working on it.
This adds a new class
PluginLoggerthat prints log messages to a separateflutter.logfile. Log messages will continue to print toidea.logalso becausePluginLoggerhas a parent logger that continues to log there.The built in
FileHandlerclass manages writing to the file and removing old lines if the file gets too big.